]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libtwolame.c
h263: Drop uninitialized variable use from log message
[ffmpeg] / libavcodec / libtwolame.c
index d8d73b3bcc75d90340ab300fbd192452bbf39001..714c30acdee9a8c81504b455f939d5cd7c825d01 100644 (file)
@@ -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)
@@ -77,7 +77,7 @@ static av_cold int twolame_encode_init(AVCodecContext *avctx)
     twolame_set_num_channels(s->glopts, avctx->channels);
     twolame_set_in_samplerate(s->glopts, avctx->sample_rate);
     twolame_set_out_samplerate(s->glopts, avctx->sample_rate);
-    if (avctx->flags & CODEC_FLAG_QSCALE || !avctx->bit_rate) {
+    if (avctx->flags & AV_CODEC_FLAG_QSCALE || !avctx->bit_rate) {
         twolame_set_VBR(s->glopts, TRUE);
         twolame_set_VBR_level(s->glopts,
                               avctx->global_quality / (float) FF_QP2LAMBDA);
@@ -148,10 +148,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;
     }
@@ -191,7 +191,6 @@ static const AVClass twolame_class = {
 
 static const AVCodecDefault twolame_defaults[] = {
     { "b", "384000" },
-    { "ar", "48000" },
     { NULL },
 };
 
@@ -208,7 +207,7 @@ AVCodec ff_libtwolame_encoder = {
     .init           = twolame_encode_init,
     .encode2        = twolame_encode_frame,
     .close          = twolame_encode_close,
-    .capabilities   = CODEC_CAP_DELAY,
+    .capabilities   = AV_CODEC_CAP_DELAY,
     .defaults       = twolame_defaults,
     .priv_class     = &twolame_class,
     .sample_fmts    = (const enum AVSampleFormat[]) {