]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/roqaudioenc.c
ratecontrol: Drop commented out cruft
[ffmpeg] / libavcodec / roqaudioenc.c
index f97d5d6e0ce1d59f4ef427a419dc1bafa090166c..f687f5cd9d9294737a84b2136679eba9d381143f 100644 (file)
@@ -32,8 +32,7 @@
 #define MAX_DPCM (127*127)
 
 
-typedef struct
-{
+typedef struct ROQDPCMContext {
     short lastSample[2];
     int input_frames;
     int buffered_samples;
@@ -147,15 +146,16 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
             context->input_frames++;
             return 0;
         }
-        in = context->frame_buffer;
     }
+    if (context->input_frames < 8)
+        in = context->frame_buffer;
 
     if (stereo) {
         context->lastSample[0] &= 0xFF00;
         context->lastSample[1] &= 0xFF00;
     }
 
-    if (context->input_frames == 7 || !in)
+    if (context->input_frames == 7)
         data_size = avctx->channels * context->buffered_samples;
     else
         data_size = avctx->channels * avctx->frame_size;
@@ -200,7 +200,7 @@ AVCodec ff_roq_dpcm_encoder = {
     .init           = roq_dpcm_encode_init,
     .encode2        = roq_dpcm_encode_frame,
     .close          = roq_dpcm_encode_close,
-    .capabilities   = CODEC_CAP_DELAY,
+    .capabilities   = AV_CODEC_CAP_DELAY,
     .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
                                                      AV_SAMPLE_FMT_NONE },
 };