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 766261 - inputselector: should proceed non-active pad buffer even if active pad reach eos
inputselector: should proceed non-active pad buffer even if active pad reach eos
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-11 09:12 UTC by kevin
Modified: 2018-05-07 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the issue. (1.61 KB, patch)
2016-05-11 09:14 UTC, kevin
rejected Details | Review

Description kevin 2016-05-11 09:12:48 UTC
non-active pad will be block if active pad reach eos currently. Has following issues:

- Hard to catch up audio if change video track which be blocked long time.
- Pipeline will hang if demux need push all video/audio data, it is our demux's design for some container format.

Change to sync with clock for better user experience.
Comment 1 kevin 2016-05-11 09:14:33 UTC
Created attachment 327631 [details] [review]
Patch to fix the issue.
Comment 2 Sebastian Dröge (slomo) 2016-05-11 10:17:35 UTC
(In reply to kevin from comment #0)
> non-active pad will be block if active pad reach eos currently. Has
> following issues:
> 
> - Hard to catch up audio if change video track which be blocked long time.

What do you mean with that?

> - Pipeline will hang if demux need push all video/audio data, it is our
> demux's design for some container format.

What does this mean? Your demuxer fails if it can't push all data? Once the pipeline goes to EOS, at some point the demuxer would just be shut down. It shouldn't care if there would be more data to send or not.

> Change to sync with clock for better user experience.

As explained on IRC this is wrong. Not every pipeline has a clock, not every input-selector should run in real-time.
Comment 3 kevin 2016-05-12 01:58:47 UTC
Let me explain our problem:

One stream has two video tracks and one audio track. One of video track has less duration than other track, so it will send eos while other track still running.

Switch to the video track which reach eos. another video track buffer will be blocked in inputselector. So demuxer will be blocked when call pad push buffer for the blocked video track.

As demuxer run in one thread, audio pipeline can't get audio data buffer as demuxer is blocked by video pad push buffer. So the whole playback pipeline is be blocked.

Is my understand wrong or our design wrong?
Comment 4 Sebastian Dröge (slomo) 2016-05-12 06:36:26 UTC
You need to have queues downstream of the demuxer after every srcpad. decodebin is doing that for you already.

But those might run full (do they?) if the EOS track is a lot shorter than the others.

I think the EOS blocking was added some time during 1.6 or 1.8 to make it possible to switch to another (longer) track if the current one went EOS.
Comment 5 kevin 2016-05-12 06:50:23 UTC
(In reply to Sebastian Dröge (slomo) from comment #4)
> You need to have queues downstream of the demuxer after every srcpad.
> decodebin is doing that for you already.
> 
> But those might run full (do they?) if the EOS track is a lot shorter than
> the others.
Yes, the queue will full and then block demuxer.
> 
> I think the EOS blocking was added some time during 1.6 or 1.8 to make it
> possible to switch to another (longer) track if the current one went EOS.
So what's your option to fix our problem?
Comment 6 Sebastian Dröge (slomo) 2016-05-12 06:53:57 UTC
I don't know, this would need more thinking about how to solve both problems at once.
Comment 7 kevin 2016-05-12 07:27:25 UTC
(In reply to Sebastian Dröge (slomo) from comment #6)
> I don't know, this would need more thinking about how to solve both problems
> at once.

What's mean of "both problem"? Do you mean my patch will cause problem to switch to another (longer) track?

My patch will proceed pad buffer sync with clock if the pipeline has clock. inputselector will drop all received buffer if the pipeline haven't clock. In this case, there is several seconds without video output if switch to another (longer) track.
Comment 8 Sebastian Dröge (slomo) 2016-05-12 08:09:54 UTC
Those two problems, yes. Your patch is wrong because it requires a clock and requires to run at clock speed as explained in comment 2
Comment 9 Tim-Philipp Müller 2016-11-11 17:21:36 UTC
What shall we do with this?
Comment 10 Sebastian Dröge (slomo) 2018-05-07 15:47:55 UTC
Closing I guess, there was no progress here for years