X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Flibtwolame.c;h=dc188575b564da162b8191975a33950e63538f45;hp=e26454bb8441a30c5ca20c6dd58fbdacc443f6a8;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/libtwolame.c b/ffmpeg/libavcodec/libtwolame.c index e26454b..dc18857 100644 --- a/ffmpeg/libavcodec/libtwolame.c +++ b/ffmpeg/libavcodec/libtwolame.c @@ -60,7 +60,7 @@ static av_cold int twolame_encode_init(AVCodecContext *avctx) int ret; avctx->frame_size = TWOLAME_SAMPLES_PER_FRAME; - avctx->delay = 512 - 32 + 1; + avctx->initial_padding = 512 - 32 + 1; s->glopts = twolame_init(); if (!s->glopts) @@ -152,10 +152,10 @@ static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if (ret < 0) // twolame error return AVERROR_UNKNOWN; - avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); if (frame) { + avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); if (frame->pts != AV_NOPTS_VALUE) - avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay); + avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding); } else { avpkt->pts = s->next_pts; }