Commit 98e83f77 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

packetizer: h264: set duration also using frame rate

parent 8a054e3c
......@@ -764,12 +764,6 @@ static block_t *OutputPicture( decoder_t *p_dec )
}
}
if( p_sps->vui.i_time_scale && p_pic->i_length == 0 )
{
p_pic->i_length = CLOCK_FREQ * i_num_clock_ts *
p_sps->vui.i_num_units_in_tick / p_sps->vui.i_time_scale;
}
if( p_sps->frame_mbs_only_flag == 0 && p_sps->vui.b_pic_struct_present_flag )
{
switch( p_sys->i_pic_struct )
......@@ -849,6 +843,21 @@ static block_t *OutputPicture( decoder_t *p_dec )
p_sys->prevdatedpoc.num = PictureOrderCount;
}
if( p_pic->i_length == 0 )
{
if( p_sps->vui.i_time_scale )
{
p_pic->i_length = CLOCK_FREQ * i_num_clock_ts *
p_sps->vui.i_num_units_in_tick / p_sps->vui.i_time_scale;
}
else
{
date_t next = p_sys->dts;
date_Increment( &next, i_num_clock_ts );
p_pic->i_length = date_Get( &next ) - date_Get( &p_sys->dts );
}
}
#if 0
msg_Err(p_dec, "F/BOC %d/%d POC %d %s ref%d fn %d fp %d %d pts %ld",
tFOC, bFOC, PictureOrderCount,
......
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