]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/aea.c
lavf: replace avio_seek(SEEK_CUR) with avio_skip where it makes sense
[ffmpeg] / libavformat / aea.c
index ec95a0f92c8bb946d5c58cdb5c17385d3eb9b5ea..2a1d24d7a2e2bf22c7864185b7eff40469d68050 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-/**
- * @file libavformat/aea.c
- */
-
 #include "avformat.h"
-#include "raw.h"
+#include "pcm.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/audioconvert.h"
 
 #define AT1_SU_SIZE     212
 
@@ -50,10 +47,9 @@ static int aea_read_probe(AVProbeData *p)
         /* Check so that the redundant bsm bytes and info bytes are valid
          * the block size mode bytes have to be the same
          * the info bytes have to be the same
-         * the block size mode and info byte can't be the same
          */
-        if (bsm_s == bsm_e && inb_s == inb_e && bsm_s != inb_s)
-            return AVPROBE_SCORE_MAX / 2;
+        if (bsm_s == bsm_e && inb_s == inb_e)
+            return AVPROBE_SCORE_MAX / 4 + 1;
     }
     return 0;
 }
@@ -66,9 +62,9 @@ static int aea_read_header(AVFormatContext *s,
         return AVERROR(ENOMEM);
 
     /* Parse the amount of channels and skip to pos 2048(0x800) */
-    url_fskip(s->pb, 264);
-    st->codec->channels = get_byte(s->pb);
-    url_fskip(s->pb, 1783);
+    avio_skip(s->pb, 264);
+    st->codec->channels = avio_r8(s->pb);
+    avio_skip(s->pb, 1783);
 
 
     st->codec->codec_type     = AVMEDIA_TYPE_AUDIO;
@@ -81,7 +77,7 @@ static int aea_read_header(AVFormatContext *s,
         return -1;
     }
 
-    st->codec->channel_layout = (st->codec->channels == 1) ? CH_LAYOUT_MONO : CH_LAYOUT_STEREO;
+    st->codec->channel_layout = (st->codec->channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
 
     st->codec->block_align = AT1_SU_SIZE * st->codec->channels;
     return 0;
@@ -98,7 +94,7 @@ static int aea_read_packet(AVFormatContext *s, AVPacket *pkt)
     return ret;
 }
 
-AVInputFormat aea_demuxer = {
+AVInputFormat ff_aea_demuxer = {
     "aea",
     NULL_IF_CONFIG_SMALL("MD STUDIO audio"),
     0,