[MPlayer-dev-eng] Prefetching/buffering files

Nambiar, Anil NambiarA at sharpsec.com
Fri Sep 2 20:15:35 CEST 2005


Hi,
            I am porting mplayer on our arm platform. It's a great player
and so decided to choose this player for porting. 
       While going through the code I noticed that mplayer is
single-threaded. I searched through the net and found the reasons for which
mplayer is single threaded. I don't want to argue, as some of the points
made by the author are right. I can live with it being single-threaded. 
            But I noticed another big problem with mplayer. It doesn't do
prefetching or buffering for the files. The demuxer just reads data on
demand, which might be ok for general systems (pc), but really sucks playing
on embedded systems. I was having a lot of frame drops while playing a 1.6
mbps avi file. Though the avg bitrate is 1.6 mbps, on close analysis I found
that at some places it was as high as 5 mbps. The file was encoded using
flask mpeg. Mplayer was not able to handle the peaks and there were a lot of
frame drops. 
            In demuxer.c I changed the code in function "ds_fill_buffer". It
checks for packets and then performs read if no packet is available. I
changed it to always read and then perform a check. This was there is some
prefetching or buffering of data, before it is actually needed. It
drastically reduced the frame drops. I have tested the change with a lot of
files and have not observed any sync loss. 
            In order to make mplayer play on the low-end embedded systems,
prefetching data could make it much faster, than otherwise.
 
Regards,
AniL 




More information about the MPlayer-dev-eng mailing list