[MPlayer-users] Segmented streaming and mplayer

Kristian R. Evensen kristrev at simula.no
Sat Sep 10 12:32:49 CEST 2011


On 10 September 2011 11:50, Kristian R. Evensen <kristrev at simula.no> wrote:
> The next challenge now is that the retrieval code, in order to fake
> buffering, has to call blocking functions. This affects the pipeping
> of output. This is probably outside the scope of this mailing list and
> more a linux-specific thing, but has anyone encountered this challenge
> and knows how to solve it?
>

I performed some more experiments with a smaller application emulating
the behavior of the part of the data retrieval application which
outputs data. The example application writes one segment to the pipe,
sleeps for some seconds and then writes a second segment. What I find
a bit confusing, is that mplayer seems to be affected by the sleep in
producer application. It does not start playing back data until after
the sleep is over, even if the entire segment has been written to
pipe. Also, if I add another sleep after the second segment has been
written, it delays playback even further.

I have made sure that the output is unbuffered. Based on my knowledge
of pipes in Linux, the applications are independent and should not be
affected by each other. Also, if I for example pipe the output to cat,
it behaves as at least I expects (it is not affected by the sleep and
writes data asap). My question is therefore, are there some special
considerations or constraints one must think of when pipeing data into
mplayer?  Playing back each of the segments independently works
perfectly, as well as when the sleeps are removed.

-Kristian


More information about the MPlayer-users mailing list