]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/adxdec.c
h264: K&R formatting cosmetics
[ffmpeg] / libavformat / adxdec.c
index 305c67431b429fe666697ae77e0b6b171b07ae03..fc83ff263b5077d8c592c391d324d71040a1bc3f 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 #include "libavutil/intreadwrite.h"
-#include "libavcodec/adx.h"
 #include "avformat.h"
 #include "internal.h"
 
@@ -66,7 +65,6 @@ static int adx_read_header(AVFormatContext *s)
 {
     ADXDemuxerContext *c = s->priv_data;
     AVCodecContext *avctx;
-    int ret;
 
     AVStream *st = avformat_new_stream(s, NULL);
     if (!st)
@@ -87,11 +85,11 @@ static int adx_read_header(AVFormatContext *s)
     }
     avctx->extradata_size = c->header_size;
 
-    ret = avpriv_adx_decode_header(avctx, avctx->extradata,
-                                   avctx->extradata_size, &c->header_size,
-                                   NULL);
-    if (ret)
-        return ret;
+    if (avctx->extradata_size < 12) {
+        av_log(s, AV_LOG_ERROR, "Invalid extradata size.\n");
+        return AVERROR_INVALIDDATA;
+    }
+    avctx->sample_rate = AV_RB32(avctx->extradata + 8);
 
     st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
     st->codec->codec_id    = s->iformat->raw_codec_id;
@@ -108,6 +106,6 @@ AVInputFormat ff_adx_demuxer = {
     .read_header    = adx_read_header,
     .read_packet    = adx_read_packet,
     .extensions     = "adx",
-    .raw_codec_id   = CODEC_ID_ADPCM_ADX,
+    .raw_codec_id   = AV_CODEC_ID_ADPCM_ADX,
     .flags          = AVFMT_GENERIC_INDEX,
 };