[MPlayer-users] mplayer 1.0rc3 - initial amount to buffer
Reimar.Doeffinger at gmx.de
Sat Apr 9 17:03:45 CEST 2011
On Fri, Apr 08, 2011 at 08:56:26AM +0100, John Stirling wrote:
> Reimar Do"ffinger wrote:
> >On Tue, Apr 05, 2011 at 04:41:33PM +0100, John Stirling wrote:
> >>Is there any way to specify an initial amount to buffer in seconds
> >>rather than bytes ?
> >No, that doesn't really work all that well.
> >In latest SVN MPlayer does print how full the buffer is when paused,
> >so that could possibly be (mis-)used to implement that kind of thing.
> >Another possibility would be to add an option that makes MPlayer wait
> >for the cache to fill for a certain amount of time.
> Thanks for the clarification.
> Doesn't sound like it should be too difficult to add..
> I think logic would be something like -
> . add a MinSecondsToBuffer option
> . on playback start request set MinBytesToBuffer to MaxBufferSize
> . once we know the audio format, bitrate etc - adjust MinBytesToBuffer
> Any rough pointers to the bits of code we'd need to hook into
> greatly appreciated. Otherwise we'll start digging around .
Adding a "max seconds to buffer" should be straight-forward.
Check at the end of stream_enable_cache (look for PREFILL_SLEEP_TIME),
changing that while condition should be enough (+ adding an option
to set the time etc.).
> once we know the audio format, bitrate etc - adjust MinBytesToBuffer
There is no point, once that prefill loop is done that cache-min
value is no longer used an thus there is no point to change it.
If you want to implement an underrun detection etc. that would
be a lot more work, and with a good chance of making things worse
rather than better.
Flash player, RealNetworks etc. all have tried a lot of stuff and
invested a lot of time and effort and haven't really gotten anything
but completely justified ridicule out of it.
More information about the MPlayer-users