[gst-devel] audio playback shift in time

franchan francis.meyvis at gmail.com
Fri Sep 4 17:23:08 CEST 2009


Hello,

I have a custom mpegts demux. It gets data through the appsrc.
Into the appsrc I push the mpegts coming from an UDP socket.
This allows to do changing from UDP socket (other mpegts stream).

When this happens I change the playbin2 first from playing to ready,
Then back to playing again.

The mpegts demux, when it sees the state change,
removes its pads and waits for the new PAT/PMT information.
When the mpegts sees the new PAT PMT, it recreates the new pads.

Before the mpegts plugin sends out the PES data,
I first send a flush-start, flush-stop and the new_segment event downstream.
with the start and position time corresponding to the first PTS
detected in the new mpegts data.

For the first socket, when starting playback, all works fine: audio
and video are in sync.
When switching the socket the video starts playing fine after 1 to 2 seconds.

However the audio behaves odd: its playback is delayed
by the amount of time socket 1 has been playing.

I verified the PTS timestamps on the input (in mpegts demux) and
the output (audio/video decoders). These all seem fine;
audio/video data is alternately push forward into the sinks.

Still the alsa sink (or something else after the audio decoder)
introduces this strange delay.

Can somebody tell me what is going on and how to remove this delay for audio
and still having the video play back as well?

Thanks,
francis




More information about the gstreamer-devel mailing list