ac3enc_template: Use the correct context field
authorVittorio Giovara <vittorio.giovara@gmail.com>
Fri, 24 Jul 2015 04:17:26 +0000 (05:17 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 27 Jul 2015 13:44:07 +0000 (14:44 +0100)
For audio encoders, delay has no effect, use the appropriate one,
initial_padding (see 2df0c32).

libavcodec/ac3enc_template.c

index 79b4946..8febf85 100644 (file)
@@ -450,7 +450,7 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
     ff_ac3_output_frame(s, avpkt->data);
 
     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);
 
     *got_packet_ptr = 1;
     return 0;