]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/g722dec.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / g722dec.c
index 000b591fe62428ac059f214eedec04d22bdd9a1f..96cf1a86f1446d434477f6a2639a3d2db67e5070 100644 (file)
@@ -100,7 +100,9 @@ static int g722_decode_frame(AVCodecContext *avctx, void *data,
         return ret;
     out_buf = (int16_t *)frame->data[0];
 
-    init_get_bits(&gb, avpkt->data, avpkt->size * 8);
+    ret = init_get_bits8(&gb, avpkt->data, avpkt->size);
+    if (ret < 0)
+        return ret;
 
     for (j = 0; j < avpkt->size; j++) {
         int ilow, ihigh, rlow, rhigh, dhigh;
@@ -137,7 +139,7 @@ static int g722_decode_frame(AVCodecContext *avctx, void *data,
     return avpkt->size;
 }
 
-AVCodec ff_adpcm_g722_decoder = {
+const AVCodec ff_adpcm_g722_decoder = {
     .name           = "g722",
     .long_name      = NULL_IF_CONFIG_SMALL("G.722 ADPCM"),
     .type           = AVMEDIA_TYPE_AUDIO,
@@ -145,6 +147,6 @@ AVCodec ff_adpcm_g722_decoder = {
     .priv_data_size = sizeof(G722Context),
     .init           = g722_decode_init,
     .decode         = g722_decode_frame,
-    .capabilities   = AV_CODEC_CAP_DR1,
+    .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
     .priv_class     = &g722_decoder_class,
 };