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 763770 - multiqueue: not-linked pads might not drain out at EOS
multiqueue: not-linked pads might not drain out at EOS
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.6.4
Assigned To: Jan Schmidt
GStreamer Maintainers
1.6.4
Depends on:
Blocks:
 
 
Reported: 2016-03-16 17:13 UTC by Jan Schmidt
Modified: 2016-07-01 09:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Check multiqueue not-linked EOS handling (13.93 KB, patch)
2016-03-16 17:14 UTC, Jan Schmidt
none Details | Review
tests: Check multiqueue not-linked EOS handling (13.93 KB, patch)
2016-03-17 16:12 UTC, Jan Schmidt
committed Details | Review
multiqueue: Fix not-linked pad handling at EOS (3.74 KB, patch)
2016-03-17 16:12 UTC, Jan Schmidt
committed Details | Review
multiqueue: Fix behaviour with not-linked and eos pads (2.85 KB, patch)
2016-07-01 07:47 UTC, Edward Hervey
accepted-commit_now Details | Review

Description Jan Schmidt 2016-03-16 17:13:05 UTC
commit #c3454a85 in core introduced a regression to multiqueue EOS handling when not-linked pads are present.

commit c3454a85c5207dfe33dcaaebf37d8163198a6816
Author: Mark Nauwelaerts <mnauw@users.sourceforge.net>
Date:   Sat Feb 21 17:13:26 2015 +0100

    multiqueue: avoid returning downstream GST_FLOW_EOS from previous segment to current upstream segment

The problem is that the not-linked pad output is throttled based on linked pads, with some logic to ignore EOS pads. The commit changed the stored srcresult which used to record that the last push result was GST_FLOW_EOS, and now it's possible that not-linked streams are not drained out. Any data which is pushed after all linked streams have gone EOS will stall in the multiqueue and never drain.

Unit test and patch coming.
Comment 1 Jan Schmidt 2016-03-16 17:14:59 UTC
Created attachment 324122 [details] [review]
tests: Check multiqueue not-linked EOS handling

Add a test which checks that not-linked pads continue
to output data after linked pads have gone EOS
Comment 2 Jan Schmidt 2016-03-17 16:12:24 UTC
Created attachment 324195 [details] [review]
tests: Check multiqueue not-linked EOS handling

Add a test which checks that not-linked pads continue
to output data after linked pads have gone EOS
Comment 3 Jan Schmidt 2016-03-17 16:12:31 UTC
Created attachment 324196 [details] [review]
multiqueue: Fix not-linked pad handling at EOS

Ensure that not-linked pads will drain out at EOS by
correctly detecting the EOS condition based on the EOS
pad flag (which indicates we actually pushed an EOS),
and make sure that not-linked pads are woken when doing
EOS processing on linked pads.
Comment 4 Thiago Sousa Santos 2016-03-17 20:08:47 UTC
I have an issue caused by this same patch but it seems this fix doesn't help me. Will keep digging to understand exactly what is happening.

(Not that this patch isn't useful, just my issue is different)
Comment 5 Jan Schmidt 2016-03-18 10:09:48 UTC
(In reply to Thiago Sousa Santos from comment #4)
> I have an issue caused by this same patch but it seems this fix doesn't help
> me. Will keep digging to understand exactly what is happening.
> 
> (Not that this patch isn't useful, just my issue is different)

What symptoms are you seeing?
Comment 6 Jan Schmidt 2016-03-18 10:22:42 UTC
I am reasonably sure that this patch a) only has any effect at EOS b) only on not-linked pads c) the current behaviour is definitely broken. I think it should go into 1.8.0, so I'm going to commit it and get as much testing as possible (and probe it every way I can over the weekend). We can always revert if a problem shows up.
Comment 7 Edward Hervey 2016-07-01 07:47:39 UTC
Created attachment 330701 [details] [review]
multiqueue: Fix behaviour with not-linked and eos pads

This is an update on c9b6848885f4675d447e823c8fb117e247658252
multiqueue: Fix not-linked pad handling at EOS

While that commit did fix the behaviour if upstream sent a GST_EVENT_EOS,
it would break the same issue when *downstream* returns GST_FLOW_EOS
(which can happen for example when downstream decoders receive data
from after the segment stop).

GST_PAD_IS_EOS() is only TRUE when a GST_EVENT_EOS has flown through it
and not when a GST_EVENT_EOS has gone through it.

In order to handle both cases, also take into account the last flow
return.
Comment 8 Edward Hervey 2016-07-01 09:06:47 UTC
commit 530001661ddba6a0b1a7a07c9805688d83a05622
Author: Edward Hervey <edward@centricular.com>
Date:   Fri Jul 1 09:44:12 2016 +0200

    multiqueue: Fix behaviour with not-linked and eos pads
    
    This is an update on c9b6848885f4675d447e823c8fb117e247658252
    multiqueue: Fix not-linked pad handling at EOS
    
    While that commit did fix the behaviour if upstream sent a GST_EVENT_EOS,
    it would break the same issue when *downstream* returns GST_FLOW_EOS
    (which can happen for example when downstream decoders receive data
    from after the segment stop).
    
    GST_PAD_IS_EOS() is only TRUE when a GST_EVENT_EOS has flown through it
    and not when a GST_EVENT_EOS has gone through it.
    
    In order to handle both cases, also take into account the last flow
    return.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763770