Browse code

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

This is the same as is done for SPS.

Anton Khirnov authored on 2015/03/29 22:20:30
Showing 1 changed files
... ...
@@ -407,8 +407,14 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
407 407
     }
408 408
     get_bits1(gb); /* vps_extension_flag */
409 409
 
410
-    av_buffer_unref(&s->vps_list[vps_id]);
411
-    s->vps_list[vps_id] = vps_buf;
410
+    if (s->vps_list[vps_id] &&
411
+        !memcmp(s->vps_list[vps_id]->data, vps_buf->data, vps_buf->size)) {
412
+        av_buffer_unref(&vps_buf);
413
+    } else {
414
+        av_buffer_unref(&s->vps_list[vps_id]);
415
+        s->vps_list[vps_id] = vps_buf;
416
+    }
417
+
412 418
     return 0;
413 419
 
414 420
 err: