]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/ape.c
build: Make the ISMV muxer select the MOV muxer
[ffmpeg] / libavformat / ape.c
index 4d13e4836c3b5155aadb10f2cf60560ed5441c28..d67e684167b40635cac8568074b8f8a70e620b6b 100644 (file)
@@ -312,12 +312,6 @@ static int ape_read_header(AVFormatContext * s)
 
     ape_dumpinfo(s, ape);
 
-    /* try to read APE tags */
-    if (pb->seekable) {
-        ff_ape_parse_tag(s);
-        avio_seek(pb, 0, SEEK_SET);
-    }
-
     av_log(s, AV_LOG_DEBUG, "Decoding file - v%d.%02d, compression level %"PRIu16"\n",
            ape->fileversion / 1000, (ape->fileversion % 1000) / 10,
            ape->compressiontype);
@@ -330,12 +324,11 @@ static int ape_read_header(AVFormatContext * s)
     total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks;
 
     st->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id        = CODEC_ID_APE;
+    st->codec->codec_id        = AV_CODEC_ID_APE;
     st->codec->codec_tag       = MKTAG('A', 'P', 'E', ' ');
     st->codec->channels        = ape->channels;
     st->codec->sample_rate     = ape->samplerate;
     st->codec->bits_per_coded_sample = ape->bps;
-    st->codec->frame_size      = MAC_SUBFRAME_SIZE;
 
     st->nb_frames = ape->totalframes;
     st->start_time = 0;
@@ -355,6 +348,12 @@ static int ape_read_header(AVFormatContext * s)
         pts += ape->blocksperframe / MAC_SUBFRAME_SIZE;
     }
 
+    /* try to read APE tags */
+    if (pb->seekable) {
+        ff_ape_parse_tag(s);
+        avio_seek(pb, 0, SEEK_SET);
+    }
+
     return 0;
 }
 
@@ -439,5 +438,5 @@ AVInputFormat ff_ape_demuxer = {
     .read_packet    = ape_read_packet,
     .read_close     = ape_read_close,
     .read_seek      = ape_read_seek,
-    .extensions = "ape,apl,mac"
+    .extensions     = "ape,apl,mac",
 };