[MPlayer-dev-eng] Re: Re: Sync problems switching mpeg1 streams
David Toso
dtoso at optushome.com.au
Sat Jan 11 21:55:07 CET 2003
Hi Denes,
Denes <pnis at coder.hu> wrote:
> Maybe a seek on stream change would help ? I haven't checked, but mplayer
> needs to empty all buffers that matter than.
> So the problem is that mplayer doesn't flush /dev/dsp (how should it know it's
> needed) ?
I tested this out but had no luck. Here is what I did:
1. I created a fifo called 'mpgpipe':
mkfifo mpgpipe
2. I created a fifo called 'cmdpipe':
mkfifo cmdpipe
3. Open xterm "x1", run:
mplayer -delay -0.216 -demuxer 2 -slave mpgpipe < cmdpipe
mplayer prints nothing and waits in slave mode for 'cmdpipe' to be opened.
4. Open xterm "x2", run:
cat > cmdpipe
cat waits for input, mplayer prints out its normal output up to "Playing feeder_mpgfile1",
but waits for 'mpgfile' to be opened and mpeg data written to it.
5. Open xterm "x3", run:
./feeder > mpgpipe
6. In xterm "x3", issue (to feeder):
load 1.mpg
mplayer starts playing 1.mpg and shows its statistics, A-V sync is around +/- 0.050
7. I wait 30 seconds, then in xterm "x3", issue (to feeder):
load 2.mpg
mplayer starts playing 2.mpg, with A-V sync now around 0.600 +/- 0.050, and begins
to drift slowly back into sync.
8. Quickly I, in xterm "x2", issue (to cat):
seek 0 2
This seems to have no effect.
Issuing however:
quit
... has the immediate effect of stoping mplayer & feeder. Then I sigint out of cat.
That seek command usually works for me playing other files directly (in slave mode) so
I assume that the seek has no effect on synchronisation. Perhaps it is because the mpeg
file is being played via the pipe, which into which mplayer may not seek?
In any case, I am still looking for a way to immediately gain A-V sync upon switching the mpeg
streams feed to mplayer.
Thank you for your suggestion Denes,
David Toso.
More information about the MPlayer-dev-eng
mailing list