Commit 882be2a1 authored by Felix Abecassis's avatar Felix Abecassis

es_out: fix potential division by zero

parent ec8fdba2
......@@ -620,7 +620,11 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
if( i_stream_duration <= i_buffering_duration && !b_forced )
{
const double f_level = __MAX( (double)i_stream_duration / i_buffering_duration, 0 );
double f_level;
if (i_buffering_duration == 0)
f_level = 0;
else
f_level = __MAX( (double)i_stream_duration / i_buffering_duration, 0 );
input_SendEventCache( p_sys->p_input, f_level );
msg_Dbg( p_sys->p_input, "Buffering %d%%", (int)(100 * f_level) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment