mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-15 21:32:12 +08:00
lavc: use AVFrame.duration instead of AVFrame.pkt_duration
This commit is contained in:
@@ -339,7 +339,7 @@ static int encode_send_frame_internal(AVCodecContext *avctx, const AVFrame *src)
|
||||
return ret;
|
||||
|
||||
avctx->internal->last_audio_frame = 1;
|
||||
return 0;
|
||||
goto finish;
|
||||
} else if (src->nb_samples > avctx->frame_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "nb_samples (%d) != frame_size (%d)\n", src->nb_samples, avctx->frame_size);
|
||||
return AVERROR(EINVAL);
|
||||
@@ -351,6 +351,15 @@ static int encode_send_frame_internal(AVCodecContext *avctx, const AVFrame *src)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
finish:
|
||||
|
||||
#if FF_API_PKT_DURATION
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (dst->pkt_duration && dst->pkt_duration != dst->duration)
|
||||
dst->duration = dst->pkt_duration;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user