[FFmpeg-cvslog] hevc: do not change the VPS if its contents are the same

Anton Khirnov git at videolan.org
Fri Apr 3 21:58:11 CEST 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Mar 29 15:20:30 2015 +0200| [ce0bc09ee2580d49fec90a6eb0de2ba1b580c854] | committer: Anton Khirnov

hevc: do not change the VPS if its contents are the same

This is the same as is done for SPS.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce0bc09ee2580d49fec90a6eb0de2ba1b580c854
---

 libavcodec/hevc_ps.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index db658be..631dca8 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:



More information about the ffmpeg-cvslog mailing list