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 793726 - gst-play-1.0 --videosink=fakesink : position gets confused
gst-play-1.0 --videosink=fakesink : position gets confused
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-02-22 16:19 UTC by Vivia Nikolaidou
Modified: 2018-11-03 12:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
playsink: route position queries to audio sink and video sink first (3.27 KB, patch)
2018-02-22 18:45 UTC, Tim-Philipp Müller
none Details | Review

Description Vivia Nikolaidou 2018-02-22 16:19:43 UTC
Use case: "Let me listen to the music on this video file"

gst-play-1.0 file.mp4 --videosink=fakesink

The time counter at the bottom of gst-play-1.0 progresses much more quickly than the audio, I assume it progresses according to the fakesink. If I pause, the correct position is displayed, but then unpausing doesn't work.

If I use --videosink="fakesink sync=true" it works fine.
Comment 1 Nicolas Dufresne (ndufresne) 2018-02-22 16:26:19 UTC
Maybe we got it wrong in gst/gstbin.c. If you look at bin_query_position_fold() function, we always keep the highest position:

  if (position > fold->max)
      fold->max = position;

If we change from max to min, and keep the lowest, you case will work. Though, if you have a dangling sink, like:

  videotestsrc ! fakesink sync=1 fakesink async=0

The position will never advance. A bit of thinking will be needed.
Comment 2 Tim-Philipp Müller 2018-02-22 16:36:49 UTC
Thing is, there should be code in playsink that always routes position queries to the audiosink if there's audio, so I don't know why that doesn't do the right thing.
Comment 3 Vivia Nikolaidou 2018-02-22 16:41:58 UTC
Think also about gst-play-1.0 file.mp4 --audiosink=fakesink (for instance, someone doesn't want to race with the "mute" key). IMHO that should not route position queries to the audiosink. It's confusing...
Comment 4 Tim-Philipp Müller 2018-02-22 16:46:50 UTC
Well, playbin is made for playback.

If you don't want audio you should disable audio via the API and not plug fakesinks :)
Comment 5 Tim-Philipp Müller 2018-02-22 18:45:27 UTC
Created attachment 368784 [details] [review]
playsink: route position queries to audio sink and video sink first

Seems that code I was talking about was never pushed upstream, ahem.

This patch solves the --videosink=fakesink problem.

When using --audiosink=fakesink it doesn't alwyas seem to resume after pausing for some reason, unless we seek/flush. But that also happens without the patch, so don't think that's related.
Comment 6 GStreamer system administrator 2018-11-03 12:03:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/421.