mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-30 13:50:50 +08:00
avcodec/libmp3lame: rescale packet duration when calculating discarded samples
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -285,7 +285,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
|
||||
&avpkt->duration);
|
||||
|
||||
discard_padding = avctx->frame_size - avpkt->duration;
|
||||
discard_padding = avctx->frame_size - ff_samples_from_time_base(avctx, avpkt->duration);
|
||||
// Check if subtraction resulted in an overflow
|
||||
if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
|
||||
|
||||
Reference in New Issue
Block a user