[gst-devel] Playbin2 with file whose length changes

Tim-Philipp Müller t.i.m at zen.co.uk
Tue Jan 19 21:50:40 CET 2010


On Tue, 2010-01-19 at 13:22 -0700, Jeffrey Barish wrote:

> The GST_MESSAGE_DURATION message is interesting, although in my quick test I 
> don't seem to be getting it.  In any case, I don't really need to know that 
> the length changed, I just need for playbin2 to play the entire file.  Is 
> that what is meant by "does not care about the length"?

There's the length/duration in time, estimations of which may change
while playing back the file (e.g. in case of a VBR mp3 file) even if the
original file doesn't change, and then there's length in bytes of the
original input file. In the first case you should/might get a DURATION
message.


> Here's what I observe, by way of example: Suppose that I start playing when 
> the sound file has a length of 1 sec.  A short time after starting play (and 
> well before play reaches the end of the sound file), the length of the sound 
> file grows to 10 seconds.  No matter.  Play stops at 1 second and there is 
> an EOS message on the bus.
> 
> There is nothing in my code that reads the length of the file, so I think 
> the problem has to be with GStreamer or with the way I am using it.

Many GStreamer plugins current don't handle files expanding while
they're being read from very well. For many cases this may not be too
difficult to fix up though, but it will likely need to be fixed at the
parser/demuxer level, so depends a lot on the file type. A little test
program to test this kind of thing would be quite useful.

 Cheers
  -Tim






More information about the gstreamer-devel mailing list