Page 1 of 1

Tracking "cache" value

Posted: 07 Jun 2012 18:35
by Claupacius
Hi,
Tracking stream cache issue was raised a number of times on this forum, but the ultimate answer was that there is no API for knowing level of cache buffer.

We want to implement some kind of proprietary HTTP adaptive streaming ( not HLS/DASH, supported by VLC ).
In order to give feedback to the streaming server the client should know a dynamics of buffer size change.

I started digging inside the code ( es_out.c and decoder.c ) and found a named variable "cache", that I can query using

Code: Select all

float f_newCache = var_GetFloat ( p_input, "cache" );
However, this variable is updated nicely when initial buffering occurs, but if bitrate is too high, this value immediately drops to 0 and starts increasing again.

I found the event, which sets "cache" value to 0 occurs in switch block of EsOutControlLocked function with value :

case ES_OUT_RESET_PCR:

This case calls EsOutChangePosition routine and inside this function "cache"value is set to 0 :

input_SendEventCache( p_sys->p_input, 0.0 );

After this event playback is paused and buffering start again.

My question is, if there an option to know buffer level before it drops to 0 ?
Probably, the "cache" variable is a wrong point to look at.

The only place that variable "cache" is updated with actual level is function EsOutDecodersStopBuffering.

Thank you in advance for the help.

Re: Tracking "cache" value

Posted: 17 Jun 2012 22:36
by Claupacius
May anybody tell me where can I see the actual value of buffer ( input or demux ) during play ?
Thanks !