Commit 5d403161 authored by Anton Mitrofanov's avatar Anton Mitrofanov

flv: Fix one frame video total duration

parent 8b9c89d3
......@@ -322,7 +322,12 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
CHECK( flv_flush_data( c ) );
double total_duration = (2 * largest_pts - second_largest_pts) * p_flv->d_timebase;
double total_duration;
/* duration algorithm fails with one frame */
if( p_flv->i_framenum == 1 )
total_duration = p_flv->i_fps_num ? (double)p_flv->i_fps_den / p_flv->i_fps_num : 0;
else
total_duration = (2 * largest_pts - second_largest_pts) * p_flv->d_timebase;
if( x264_is_regular_file( c->fp ) && total_duration > 0 )
{
......
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