GNOME Bugzilla – Bug 589515
playbin: add support for loading subtitles after playback has started
Last modified: 2018-11-03 11:15:14 UTC
+++ This bug was initially created as a clone of Bug #514050 +++ Using the patches in Bug 514050 comment 5, playbin2 should be able to load text subtitles on the fly. But no subtitles are displayed when using this method.
Should be quite easy to fix after I've fixed #570753 and everything blocked by it.
Currently setting suburi, will set the new subtitle URI on the next playbin2 group. What is wanted is, that the new subtitle URI is set on the active group and any old suburidecodebin is deactivated and a new one is created with the new subtitle URI. But this should only be done before about-to-finish is emitted. Not sure if it's a good idea to set suburidecodebin to NULL and create a new one in set_property though...
Ok, thought about it a bit more: Setting a suburi before the next group has a non-NULL URI or before the current group is about-to-finish should load the subtitles into the current group and deactivate any already existing subtitles. Would that be good enough for you, Bastien? Wim, do you think that doing that and activating/deactivating the suburidecodebin from set_property will be a good idea too?
Works almost... now there's only the problem with updating the suburi during playback. For this the old subtitle uridecodebin needs to be stopped and started again with the new suburi. Unfortunately this requires to take the stream lock (state change), which will lead to locking for a long long time :) Maybe the old subtitle uridecodebin needs to be moved out of the way and should be deactivated later instead...
...which works but introduces a lot of other problems. For example the old subtitle stream would still be there and removing it is not easy.
I guess for now I could implement it as follows: a) before being in PAUSED it's possible to change the suburi multiple times b) when in PAUSED and no suburi was set it's possible to set one a single time c) changing a suburi in PAUSED will be a no-op until the URI of the next track is set, then it will set the suburi of the next track
Created attachment 147812 [details] [review] playbin2: Allow enabling external subtitles during playback This will only work if no external subtitles were enabled before and if the next group doesn't have an URI yet. See bug #589515.
*** Bug 649303 has been marked as a duplicate of this bug. ***
I think that being able to change from a text subtitle to another is a requirement of this request. Otherwise it makes testing different text subtitles (the main reason why you would use this functionality) difficult (and even more difficult from the stand-point of application developers).
-- 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/20.