-
-
Save rcombs/7a5af2095d147f13ccfbe782936bc03b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/libavformat/allformats.c b/libavformat/allformats.c | |
index 6fd8aa609b..3f105f8b31 100644 | |
--- a/libavformat/allformats.c | |
+++ b/libavformat/allformats.c | |
@@ -189,6 +189,7 @@ void av_register_all(void) | |
REGISTER_DEMUXER (MM, mm); | |
REGISTER_MUXDEMUX(MMF, mmf); | |
REGISTER_MUXDEMUX(MOV, mov); | |
+ REGISTER_MUXDEMUX(MP1, mp1); | |
REGISTER_MUXDEMUX(MP2, mp2); | |
REGISTER_MUXDEMUX(MP3, mp3); | |
REGISTER_MUXER (MP4, mp4); | |
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c | |
index 499aa45fd4..fbab5fef6a 100644 | |
--- a/libavformat/mp3dec.c | |
+++ b/libavformat/mp3dec.c | |
@@ -105,7 +105,8 @@ static int mpa_read_probe(AVProbeData *p, int layer) | |
if (first_frames>=7) return AVPROBE_SCORE_EXTENSION + 1; | |
else if(max_frames>200)return AVPROBE_SCORE_EXTENSION; | |
else if(max_frames>=4 && max_frames >= p->buf_size/10000) return AVPROBE_SCORE_EXTENSION / 2; | |
- else if(ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v2_tag_len(buf0) >= p->buf_size) | |
+ else if(ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v2_tag_len(buf0) >= p->buf_size && | |
+ (p->buf_size < PROBE_BUF_MAX || layer == 3)) | |
return p->buf_size < PROBE_BUF_MAX ? AVPROBE_SCORE_EXTENSION / 4 : AVPROBE_SCORE_EXTENSION - 2; | |
else if(first_frames > 1 && whole_used) return 5; | |
else if(max_frames>=1 && max_frames >= p->buf_size/10000) return 1; | |
@@ -615,5 +616,6 @@ AVInputFormat ff_mp##l##_demuxer = { \ | |
.priv_class = &demuxer_class_##l, \ | |
}; | |
+DECLARE_LAYER(1, "mp1,mups,mpa") | |
DECLARE_LAYER(2, "mp2,m2a,mpa") | |
DECLARE_LAYER(3, "mp3,mpa") | |
diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c | |
index 0edcd1cf99..76022563fa 100644 | |
--- a/libavformat/rawenc.c | |
+++ b/libavformat/rawenc.c | |
@@ -337,6 +337,19 @@ AVOutputFormat ff_mlp_muxer = { | |
}; | |
#endif | |
+#if CONFIG_MP1_MUXER | |
+AVOutputFormat ff_mp1_muxer = { | |
+ .name = "mp1", | |
+ .long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), | |
+ .mime_type = "audio/mpeg", | |
+ .extensions = "mp1,m1a,mups", | |
+ .audio_codec = AV_CODEC_ID_MP1, | |
+ .video_codec = AV_CODEC_ID_NONE, | |
+ .write_packet = ff_raw_write_packet, | |
+ .flags = AVFMT_NOTIMESTAMPS, | |
+}; | |
+#endif | |
+ | |
#if CONFIG_MP2_MUXER | |
AVOutputFormat ff_mp2_muxer = { | |
.name = "mp2", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment