mpegvideoparse: tweak extension handling
authorMark Nauwelaerts <mnauw@users.sourceforge.net>
Sun, 10 Nov 2013 11:17:18 +0000 (12:17 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 26 Nov 2013 11:46:47 +0000 (12:46 +0100)
gst/videoparsers/gstmpegvideoparse.c

index b02b10d7295146ecd92826c22f21aff3f77b0ebe..1feb3c52b4876316d5b7a2d554f5f72ba18290ca 100644 (file)
@@ -504,9 +504,14 @@ gst_mpegv_parse_process_sc (GstMpegvParse * mpvparse,
       break;
     case GST_MPEG_VIDEO_PACKET_EXTENSION:
       GST_LOG_OBJECT (mpvparse, "startcode is VIDEO PACKET EXTENSION");
-      parse_packet_extension (mpvparse, info, off);
-      if (mpvparse->ext_count < G_N_ELEMENTS (mpvparse->ext_offsets))
-        mpvparse->ext_offsets[mpvparse->ext_count++] = off;
+      if (mpvparse->pic_offset >= 0) {
+        GST_LOG_OBJECT (mpvparse, "... considered PICTURE EXTENSION");
+        parse_packet_extension (mpvparse, info, off);
+      } else {
+        GST_LOG_OBJECT (mpvparse, "... considered SEQUENCE EXTENSION");
+        if (mpvparse->ext_count < G_N_ELEMENTS (mpvparse->ext_offsets))
+          mpvparse->ext_offsets[mpvparse->ext_count++] = off;
+      }
       checkconfig = FALSE;
       break;
     default: