[MPlayer-dev-eng] [PATCH] Fix the handling of growing files

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Mar 11 19:53:48 CET 2012


On Sat, Mar 03, 2012 at 08:12:48PM +0100, Balazs Kezes wrote:
> Mplayer currently doesn't seem to handle the growing files. They are
> usually used when you stream something from the web (e.g. youtube-dl).
> 
> Now when mplayer reaches the offset which was the size at the open time
> it just quits with various errors.
> 
> 
> Here's a simple way to reproduce. Get/download a movie and do the
> following (let's name our movie b.mp4):
> $ size=$((2*1024*1024))
> $ head -c $size b.mp4 > a.mp4
> 
> Now start mplayer a.mp4. Tweak the size parameter to have around ~10
> seconds of movie. Mplayer will quit when it reaches the 10th second. Now
> do this:
> 
> $ head -c $size b.mp4 > a.mp4
> $ [start the movie in the background and wait until it begins to play]
> $ tail -c +$((size+1)) b.mp4 >> a.mp4
> 
> Mplayer will still quit at the 10th second even though it could continue
> playing (VLC continues to play without a hitch).
> 
> 
> Mplayer used to continue playing but it was because ffmpeg was buggy and
> stopped working after the following patch has been introduced:
> http://patches.libav.org/patch/14105/
> 
> I'm not sure how to fix this properly but this patch seems to fix this
> on my computer.

I don't think it will work with -nocache.
I've attached an untested patch for what I think could work,
but I can also think of several reasons why it might cause issues.
Testing and polishing welcome.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: endpos_up.diff
Type: text/x-diff
Size: 2356 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120311/bc0167d5/attachment.bin>


More information about the MPlayer-dev-eng mailing list