Commit dacfc1a7 authored by Gildas Bazin's avatar Gildas Bazin

* modules/packetizer/mpeg4video.c: work-around for buggy streams.

parent c4f5ef79
......@@ -31,6 +31,7 @@
#include <vlc/vlc.h>
#include <vlc/decoder.h>
#include <vlc/sout.h>
#include <vlc/input.h> /* hmmm, just for INPUT_RATE_DEFAULT */
#include "vlc_bits.h"
......@@ -355,11 +356,21 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
(i_modulo_time_base * p_dec->p_sys->i_fps_num);
}
if( p_dec->p_sys->i_fps_num )
if( p_dec->p_sys->i_fps_num < 5 && /* Work-around buggy streams */
p_dec->fmt_in.video.i_frame_rate > 0 &&
p_dec->fmt_in.video.i_frame_rate_base > 0 )
{
p_sys->i_interpolated_pts += I64C(1000000) *
p_dec->fmt_in.video.i_frame_rate_base *
p_block->i_rate / INPUT_RATE_DEFAULT /
p_dec->fmt_in.video.i_frame_rate;
}
else if( p_dec->p_sys->i_fps_num )
p_sys->i_interpolated_pts +=
( (i_time_ref + i_time_increment -
( I64C(1000000) * (i_time_ref + i_time_increment -
p_sys->i_last_time - p_sys->i_last_timeincr) *
I64C(1000000) / p_dec->p_sys->i_fps_num );
p_block->i_rate / INPUT_RATE_DEFAULT /
p_dec->p_sys->i_fps_num );
p_sys->i_last_time = i_time_ref;
p_sys->i_last_timeincr = i_time_increment;
......
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