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" );
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.