[Bug 772730] New: [Gstavdemux] check if we ran outside of the segment

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Oct 11 07:16:27 UTC 2016


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

            Bug ID: 772730
           Summary: [Gstavdemux] check if we ran outside of the segment
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-libav
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: r97922153 at gmail.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Dear all: 

I wonder the correctness about the flow within Gstavdemux to check  if we ran
outside of the segment. 

Please see the following flow. 

  /* do timestamps, we do this first so that we can know when we 
   * stepped over the segment stop position. */ 
  timestamp = gst_ffmpeg_time_ff_to_gst (pkt.pts, avstream->time_base); 
  if (GST_CLOCK_TIME_IS_VALID (timestamp)) { 
    stream->last_ts = timestamp; 
  } 
  ... 
  if (GST_CLOCK_TIME_IS_VALID (timestamp)) 
    timestamp -= demux->start_time; 
  ... 

  /* check if we ran outside of the segment */ 
  if (demux->segment.stop != -1 && timestamp > demux->segment.stop) 
    goto drop;

When we are given the settings below and it means we want to playback P1 B3 B4
only. 

Presentation order =  I1 B1 B2 { P1 B3 B4 } I2 
decoding      order =  I1 P1 B1 B2 I2 B3 B4 

PTS of ( I1 B1 B2 P1 B3 B4  I2) = ( 1, 2, 3, 4, 5, 6, 7) 
DTS of ( I1 B1 B2 P1 B3 B4  I2) = (1, 3, 4, 2, 6, 7, 5) 

The segment stop is set to "6" accordingly since the PTS of {P1 B3 B4} = ( 4,
5, 6 ). 

However, notice that the PTS of I2 is "7" which is larger than 6. Also we will
demux it before B3 & B4. 

By the flow : "check if we ran outside of the segment", we will go to the drop
label & pause where. 

The result is we miss the following two B frames, which should be played
originally. 


I think an additional check such as "if we have met the first Key frame whose
PTS is greater than segment's stop, go to drop (pause)" will be safe. 


Thanks.

-- 
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