mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
hlsdemux: Send a flush-stop when switching pads. Fixes A->A/V sync issue.
This is to ensure that we reset the accumulate segment on the sinks so if we start with audio only then switch to audio+video, then both sinks will have the same segments and will be synchronized.
This commit is contained in:
parent
ed5a5cc139
commit
f93939b46c
1 changed files with 12 additions and 0 deletions
|
@ -670,6 +670,18 @@ switch_pads (GstHLSDemux * demux, GstCaps * newcaps)
|
|||
|
||||
GST_DEBUG ("Switching pads (oldpad:%p)", oldpad);
|
||||
|
||||
/* FIXME: This is a workaround for a bug in playsink.
|
||||
* If we're switching from an audio-only or video-only fragment
|
||||
* to an audio-video segment, the new sink doesn't know about
|
||||
* the current running time and audio/video will go out of sync.
|
||||
*
|
||||
* This should be fixed in playsink by distributing the
|
||||
* current running time to newly created sinks and is
|
||||
* fixed in 0.11 with the new segments.
|
||||
*/
|
||||
if (demux->srcpad)
|
||||
gst_pad_push_event (demux->srcpad, gst_event_new_flush_stop ());
|
||||
|
||||
/* First create and activate new pad */
|
||||
demux->srcpad = gst_pad_new_from_static_template (&srctemplate, NULL);
|
||||
gst_pad_set_event_function (demux->srcpad,
|
||||
|
|
Loading…
Reference in a new issue