Commit fe61a857 authored by Christophe Mutricy's avatar Christophe Mutricy

Backport of [11222] to 0.8.2

parent c860e783
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/decoder.h> #include <vlc/decoder.h>
#include <vlc/sout.h> #include <vlc/sout.h>
#include <vlc/input.h> /* hmmm, just for INPUT_RATE_DEFAULT */
#include "vlc_bits.h" #include "vlc_bits.h"
...@@ -345,11 +346,21 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -345,11 +346,21 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
(i_modulo_time_base * p_dec->p_sys->i_fps_num); (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 += 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) * 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_time = i_time_ref;
p_sys->i_last_timeincr = i_time_increment; 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