Commit f7e0344e authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/libmpeg2.c, ffmpeg/video.c, theora.c: decoder sets fmt_out.video.i_frame_rate.

parent b6e85ad8
...@@ -185,6 +185,12 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec, ...@@ -185,6 +185,12 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
} }
} }
if( p_context->frame_rate > 0 && p_context->frame_rate_base > 0 )
{
p_dec->fmt_out.video.i_frame_rate = p_context->frame_rate;
p_dec->fmt_out.video.i_frame_rate_base = p_context->frame_rate_base;
}
p_pic = p_dec->pf_vout_buffer_new( p_dec ); p_pic = p_dec->pf_vout_buffer_new( p_dec );
#ifdef LIBAVCODEC_PP #ifdef LIBAVCODEC_PP
......
...@@ -594,9 +594,21 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf ) ...@@ -594,9 +594,21 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf )
picture_t *p_pic; picture_t *p_pic;
p_dec->fmt_out.video.i_width = p_sys->p_info->sequence->width; p_dec->fmt_out.video.i_width = p_sys->p_info->sequence->width;
p_dec->fmt_out.video.i_visible_width =
p_sys->p_info->sequence->picture_width;
p_dec->fmt_out.video.i_height = p_sys->p_info->sequence->height; p_dec->fmt_out.video.i_height = p_sys->p_info->sequence->height;
p_dec->fmt_out.video.i_visible_height =
p_sys->p_info->sequence->picture_height;
p_dec->fmt_out.video.i_aspect = p_sys->i_aspect; p_dec->fmt_out.video.i_aspect = p_sys->i_aspect;
if( p_sys->p_info->sequence->frame_period > 0 )
{
p_dec->fmt_out.video.i_frame_rate =
(uint32_t)( (uint64_t)1001000000 * 27 /
p_sys->p_info->sequence->frame_period );
p_dec->fmt_out.video.i_frame_rate_base = 1001;
}
p_dec->fmt_out.i_codec = p_dec->fmt_out.i_codec =
( p_sys->p_info->sequence->chroma_height < ( p_sys->p_info->sequence->chroma_height <
p_sys->p_info->sequence->height ) ? p_sys->p_info->sequence->height ) ?
......
...@@ -294,6 +294,12 @@ static int ProcessHeaders( decoder_t *p_dec ) ...@@ -294,6 +294,12 @@ static int ProcessHeaders( decoder_t *p_dec )
p_sys->ti.frame_width / p_sys->ti.frame_height; p_sys->ti.frame_width / p_sys->ti.frame_height;
} }
if( p_sys->ti.fps_numerator > 0 && p_sys->ti.fps_denominator > 0 )
{
p_dec->fmt_out.video.i_frame_rate = p_sys->ti.fps_numerator;
p_dec->fmt_out.video.i_frame_rate_base = p_sys->ti.fps_denominator;
}
msg_Dbg( p_dec, "%dx%d %.02f fps video, frame content " msg_Dbg( p_dec, "%dx%d %.02f fps video, frame content "
"is %dx%d with offset (%d,%d)", "is %dx%d with offset (%d,%d)",
p_sys->ti.width, p_sys->ti.height, p_sys->ti.width, p_sys->ti.height,
......
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