[MPlayer-dev-eng] [RFC] Playing growing file

Vlad Seryakov vseryakov at gmail.com
Thu Jan 5 20:09:36 CET 2012


>> No problem, i never thought it will make it but wanted to get opinion if it is possible. Actually, i wanted to use it with MPEG TS files only, recording from DVB tuner, never thought about playing other file formats. I've added some timeouts so it will exit if no data after some interval but never sent it. Without maintaining proper length it may work in very narrow cases and may never be usable generically. For example, in my case i do not care about duration, i have guide info and know how long any particular program will run for, but without it, duration is necessary and this may require updating all demuxers to detect new file length but for some formats even that may not work well
>> 
> Hi Vlad, Incidentally, I am also playing back MPEG TS (or maybe PS, not 
> sure) files recorded by HVR-1950, but for testing I grabbed an .mkv, 
> which is where I discovered the problem.
> You are correct about the length, although mplayer seems to be happily 
> playing MPEG files as long as new data keeps coming.
> Unfortunately, in my particular case I do need to know the current 
> length of the file. And for that I have to resort to a special form of 
> hackery, which is made possible by your mod and is described in my other 
> post. :)
> Anyway, thanks for your patch.
> -D

Alternatively, because grow: stream updates stream->end_pos constantly, one easy change in ts_parse before returning packet length would be to update demuxer->movi_end, this way demuxer_get_time_length would use it every time and return actual file length.
Just add 
demuxer->movi_end = demuxer->stream->end_pos; 
in demux_ts.c before line 3081. This will not hurt if playing regular files but will work for growing files, i think.
Let me know if this will work.

Thanks


More information about the MPlayer-dev-eng mailing list