[Bug 777073] streamsynchronizer: Can't complete preroll in case pause/seek is called after one of streams receive EOS

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Jan 26 12:46:00 UTC 2017


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

Sebastian Dröge (slomo) <slomo at coaxion.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #344286|none                        |needs-work
             status|                            |

--- Comment #11 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
Review of attachment 344286:
 --> (https://bugzilla.gnome.org/review?bug=777073&attachment=344286)

There are various problems in the patch, but I also don't really understand how
it solves the problem and what exactly the problem is.

The problem is that for EOS streams we would have to send a GAP event (just
like for lagging streams), so that downstream advances/prerolls? And we would
set the GAP event timestamp to >= segment.stop, causing it to be just dropped
downstream? I think that a buffer that has timestamp=segment.stop && duration=0
is considered inside the segment (can you confirm in gstsegment.c?), in which
case the same should also apply to GAP events (might need fixing) and we should
just send such a GAP event then.

::: gst/playback/gststreamsynchronizer.c
@@ +573,3 @@
       srcpad = gst_object_ref (stream->srcpad);

+      if (!seen_data || !GST_CLOCK_TIME_IS_VALID (stream->segment.position)) {

You inverse this condition but the code below stays more or less the same. Why
is this correct?

@@ +585,3 @@
+      if (GST_CLOCK_TIME_IS_VALID (stream->segment.stop) &&
+          stream->segment.position >= stream->segment.stop)
+        stream->segment.position = stream->segment.stop - G_USEC_PER_SEC;

Why G_USEC_PER_SEC? You probably want GST_SECOND but also why that? And if you
want to subtract something, you need to ensure that you don't go below zero
(i.e. underflow)

@@ -738,3 @@
-    if (!GST_CLOCK_TIME_IS_VALID (timestamp_end) &&
-        GST_CLOCK_TIME_IS_VALID (timestamp)) {
-      timestamp_end = timestamp + GST_SECOND;

Check "git blame" why this was added

@@ -756,3 @@
-      /* Is there a 1 second lag? */
-      if (position != -1 && GST_CLOCK_TIME_IS_VALID (timestamp_end) &&
-          position + GST_SECOND < timestamp_end) {

You're completely removing the advancing of lagging streams here

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