]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/gsmdec.c
http: Reduce scope of a variable in parse_content_encoding()
[ffmpeg] / libavformat / gsmdec.c
index 5d6495860ae1060de1360975f9f9f061fb44b06c..f9ecbafcda8cebc743fb2a8e4df22a1d7a29cb47 100644 (file)
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/channel_layout.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "avformat.h"
@@ -62,8 +63,9 @@ static int gsm_read_header(AVFormatContext *s)
         return AVERROR(ENOMEM);
 
     st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id    = s->iformat->value;
+    st->codec->codec_id    = s->iformat->raw_codec_id;
     st->codec->channels    = 1;
+    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
     st->codec->sample_rate = c->sample_rate;
     st->codec->bit_rate    = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES;
 
@@ -74,7 +76,7 @@ static int gsm_read_header(AVFormatContext *s)
 
 static const AVOption options[] = {
     { "sample_rate", "", offsetof(GSMDemuxerContext, sample_rate),
-       AV_OPT_TYPE_INT, {.dbl = GSM_SAMPLE_RATE}, 1, INT_MAX / GSM_BLOCK_SIZE,
+       AV_OPT_TYPE_INT, {.i64 = GSM_SAMPLE_RATE}, 1, INT_MAX / GSM_BLOCK_SIZE,
        AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
@@ -94,6 +96,6 @@ AVInputFormat ff_gsm_demuxer = {
     .read_packet    = gsm_read_packet,
     .flags          = AVFMT_GENERIC_INDEX,
     .extensions     = "gsm",
-    .value          = CODEC_ID_GSM,
+    .raw_codec_id   = AV_CODEC_ID_GSM,
     .priv_class     = &class,
 };