[Bug 711627] mpegvparse: Incorrect repositioning of start code location when input buffer is empty

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Nov 7 10:48:56 PST 2013


https://bugzilla.gnome.org/show_bug.cgi?id=711627
  GStreamer | gst-plugins-bad | 1.x

--- Comment #3 from Greg Rutz <g.rutz at cablelabs.com> 2013-11-07 18:48:49 UTC ---
This change is the one that is causing the check of the TSN (and it was
committed after the change you mention above).  I think this change requires
the reverting of Mark's change, since we need to re-parse the start_code to
trigger the continued parsing of the TSN from the picture header, which will
result in the decision about whether this start code will terminate the
previous frame.  So, I think my change is still valid. 

commit e5ebd7d846a296f6018cf2af32fd229a4a05f424
Author: Matej Knopp <matej.knopp at gmail.com>
Date:   Tue Jul 30 15:17:23 2013 +0200

    mpegvideoparse: support field encoding for interlaced video

    https://bugzilla.gnome.org/show_bug.cgi?id=705144

diff --git a/gst/videoparsers/gstmpegvideoparse.c
b/gst/videoparsers/gstmpegvideoparse.c
index 073a330..b5a6d01 100644
--- a/gst/videoparsers/gstmpegvideoparse.c
+++ b/gst/videoparsers/gstmpegvideoparse.c
@@ -540,6 +540,21 @@ gst_mpegv_parse_process_sc (GstMpegvParse * mpvparse,
     else
       GST_LOG_OBJECT (mpvparse, "Couldn't parse picture at offset %d",
           mpvparse->pic_offset);
+
+    /* if terminating packet is a picture, we need to check if it has same TSN
as the pict
+       terminated. If it does, we need to keep those together, as these
packets are two fi
+       frame */
+    if (packet->type == GST_MPEG_VIDEO_PACKET_PICTURE) {
+      if (info->size - off < 2) {       /* we need at least two bytes to read
the TSN */
+        ret = FALSE;
+      } else {
+        /* TSN is stored in first 10 bits */
+        int tsn = info->data[off] << 2 | (info->data[off + 1] & 0xC0) >> 6;
+
+        if (tsn == mpvparse->pichdr.tsn)        /* prevent termination if TSN
is same */
+          ret = FALSE;
+      }
+    }
   }

   return ret;

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list