After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790167 - concat: Handle single-pad use-cases
concat: Handle single-pad use-cases
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-10 13:15 UTC by Edward Hervey
Modified: 2017-11-11 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
concat: Handle single-pad use-cases (3.08 KB, patch)
2017-11-10 13:15 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2017-11-10 13:15:45 UTC
See patch
Comment 1 Edward Hervey 2017-11-10 13:15:48 UTC
Created attachment 363343 [details] [review]
concat: Handle single-pad use-cases

When EOS reaches concat, it will switch to the next candidate as its
activate pad.

The problem arises when there is only one sinkpad, the "active" pad
becomes NULL. This results in concat becoming unusable after it receives
a *single* EOS on its single sinkpad.

If we detect there is a single sinkpad and there is no current active pad:
* If we are waiting (from selected sink event/buffer), become the current
  active pad.
* If there is a seek request, send it upstream. We don't switch the
  active_sinkpad property at that point in time, since the seek could
  fail. If the seek succeeds, the following SEGMENT (or STREAM_START)
  will cause the pad_wait() to elect that pad as the new active one.
* Flush events get forwarded
Comment 2 Nicolas Dufresne (ndufresne) 2017-11-10 14:48:21 UTC
Review of attachment 363343 [details] [review]:

I think this makes sense, re-reading some of my code, I notice that I simply remove the concat and create a new one if it reached that state. Being able to flush or seek it seems rather useful.

::: plugins/elements/gstconcat.c
@@ +398,3 @@
+    if (self->current_sinkpad == NULL && g_list_length (self->sinkpads) == 1) {
+      GST_LOG_OBJECT (spad, "Sole pad waiting, switching");
+      /* If we are the only sinkpad, take active pad ownership */

Maybe "If there is only one sinkpad, ..."
Comment 3 Edward Hervey 2017-11-10 15:56:45 UTC
Comment on attachment 363343 [details] [review]
concat: Handle single-pad use-cases

commit f03443f90c6d5d143861f5e75990d06b700a5895 (HEAD -> master, origin/master, origin/HEAD)
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Fri Nov 10 14:10:31 2017 +0100

    concat: Handle single-pad use-cases
    
    When EOS reaches concat, it will switch to the next candidate as its
    activate pad.
    
    The problem arises when there is only one sinkpad, the "active" pad
    becomes NULL. This results in concat becoming unusable after it receives
    a *single* EOS on its single sinkpad.
    
    If we detect there is a single sinkpad and there is no current active pad:
    * If we are waiting (from selected sink event/buffer), become the current
      active pad.
    * If there is a seek request, send it upstream. We don't switch the
      active_sinkpad property at that point in time, since the seek could
      fail. If the seek succeeds, the following SEGMENT (or STREAM_START)
      will cause the pad_wait() to elect that pad as the new active one.
    * Flush events get forwarded
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790167
Comment 4 Tim-Philipp Müller 2017-11-11 12:02:24 UTC
This should've been closed, right?