[MPlayer-users] General question regarding timeshifting...

Christopher Caldwell caldwell_christopher at hotmail.com
Thu Jun 19 02:52:14 CEST 2003


(and such great documentation it is)

Greetings,

I'd like to re-ask the "can we do timeshifting" question in a different 
light.  It has been
pointed out in previous e-mail that the timeshifting issue is basically 
breaking the
software into two pieces:  Sucking the data in ... and writing it out.

OK, I have done exactly that.  I have a "data source" program (streamer, 
tccat,
any number of others) we put the data in a file.  Then I have mplayer 
reading the
data out of that file.

This works OK as long as the program writing the data TO the file is done 
before
mplayer starts reading the data FROM the file.  There are many problems if 
the file
is still being written to or is still empty.

The first problem occurs because mplayer likes to seek around to look at 
headers
etc. and to do this it determines the file length before it starts up.  As 
near as I can
tell, it doesn't think it ever needs to look at the file length again even 
though the
file may be continually growing.

In the second case, mplayer sees a zero length file and terminates (which is 
what
I would expect).

I tweaked the input reading routines of mplayer so that if a flag was set 
(the sticky
bit is set on the file), it would sleep for a second and read again if it 
saw end of file.

Thats OK under some limited circumstances, but it doesn't work for those 
demuxing
use the initial file length to determine how to read the file.

The obvious solution here would be to use some sort of data stream instead 
of the
file i/o.  OK, but that ends up preventing you from seeking backwards and 
the
double buffering that caching implies seems akward.

I write this to provoke thought for possible "have my cake and eat it too" 
solutions.

To make this more concrete, I'll pass along an example.  I write to the file 
with
something like "touch foo.avi; chmod +t foo.avi; tccat -i /dev/dvd -T 1 > 
foo.avi &".

I then would like to "mplayer foo.avi" realizing that the tccat hadn't 
completed yet.

Thoughts?  --Chris

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail



More information about the MPlayer-users mailing list