aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc_ps.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-03-29 15:20:30 +0200
committerAnton Khirnov <anton@khirnov.net>2015-04-03 13:10:03 +0200
commitce0bc09ee2580d49fec90a6eb0de2ba1b580c854 (patch)
treed500865f33a5e59689880b59c43df96044594fc7 /libavcodec/hevc_ps.c
parent7693ba0a0eecdcdba71b7fbd9a4a12d1ba7b82aa (diff)
downloadffmpeg-ce0bc09ee2580d49fec90a6eb0de2ba1b580c854.tar.gz
hevc: do not change the VPS if its contents are the same
This is the same as is done for SPS.
Diffstat (limited to 'libavcodec/hevc_ps.c')
-rw-r--r--libavcodec/hevc_ps.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index db658bed2d..631dca85f2 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -407,8 +407,14 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
}
get_bits1(gb); /* vps_extension_flag */
- av_buffer_unref(&s->vps_list[vps_id]);
- s->vps_list[vps_id] = vps_buf;
+ if (s->vps_list[vps_id] &&
+ !memcmp(s->vps_list[vps_id]->data, vps_buf->data, vps_buf->size)) {
+ av_buffer_unref(&vps_buf);
+ } else {
+ av_buffer_unref(&s->vps_list[vps_id]);
+ s->vps_list[vps_id] = vps_buf;
+ }
+
return 0;
err: