Commit 61a35dcd authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Backport [18589]

parent 0123bbfc
...@@ -836,10 +836,10 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) ...@@ -836,10 +836,10 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
} }
else else
{ {
frame.pts = AV_NOPTS_VALUE; frame.pts = (int64_t)AV_NOPTS_VALUE;
} }
if ( frame.pts != (int64_t) AV_NOPTS_VALUE && frame.pts != 0 ) if ( frame.pts != (int64_t)AV_NOPTS_VALUE && frame.pts != 0 )
{ {
if ( p_sys->i_last_pts == frame.pts ) if ( p_sys->i_last_pts == frame.pts )
{ {
...@@ -891,7 +891,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) ...@@ -891,7 +891,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
/* No delay -> output pts == input pts */ /* No delay -> output pts == input pts */
p_block->i_pts = p_block->i_dts = p_pict->date; p_block->i_pts = p_block->i_dts = p_pict->date;
} }
else if( p_sys->p_context->coded_frame->pts != (signed int) AV_NOPTS_VALUE && else if( p_sys->p_context->coded_frame->pts != (int64_t)AV_NOPTS_VALUE &&
p_sys->p_context->coded_frame->pts != 0 && p_sys->p_context->coded_frame->pts != 0 &&
p_sys->i_buggy_pts_detect != p_sys->p_context->coded_frame->pts ) p_sys->i_buggy_pts_detect != p_sys->p_context->coded_frame->pts )
{ {
...@@ -901,11 +901,11 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict ) ...@@ -901,11 +901,11 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
/* Ugly work-around for stupid libavcodec behaviour */ /* Ugly work-around for stupid libavcodec behaviour */
#if LIBAVCODEC_BUILD >= 4722 #if LIBAVCODEC_BUILD >= 4722
{ {
int64_t i_framenum = p_block->i_pts * int64_t i_framenum = p_block->i_pts *
p_enc->fmt_in.video.i_frame_rate / p_enc->fmt_in.video.i_frame_rate /
p_enc->fmt_in.video.i_frame_rate_base / AV_TIME_BASE; p_enc->fmt_in.video.i_frame_rate_base / AV_TIME_BASE;
p_block->i_pts = p_sys->pi_delay_pts[i_framenum % MAX_FRAME_DELAY]; p_block->i_pts = p_sys->pi_delay_pts[i_framenum % MAX_FRAME_DELAY];
} }
#endif #endif
/* End work-around */ /* End work-around */
......
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