summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authornu774 <honeycomb77@gmail.com>2014-05-09 23:05:42 +0900
committerLuca Barbato <lu_zero@gentoo.org>2015-06-20 12:18:01 +0300
commit6ec688e1bc76dd93151cbca1c340162ae4b10d77 (patch)
tree908c2bdc32acbf8be895b0cdcdfdcd99d1bbf48a /libavformat/mov.c
parent1e79d5c6e73ad131f9395f337b58a2b59ee04c1b (diff)
mp3: enable packed main_data decoding in MP4
14496-3 suggests packing main_data of MP3 that is usually scattered into multiple frames due to bit reservoir. However, after packing main_data into a access unit, bitrate index in the MPEG audio frame header doesn't match with actual frame size. In order to accept this, this patch removes unnecessary frame size checking on mp3 decoder. Also, mov demuxer was changed to use MP3 parser only on special cases (QT MOV with specific sample description) to avoid re-packetizing. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f603446d98..b922579ac0 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1519,6 +1519,15 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
ff_mov_get_lpcm_codec_id(st->codec->bits_per_coded_sample,
flags);
}
+ if (version == 0 || (version == 1 && sc->audio_cid != -2)) {
+ /* can't correctly handle variable sized packet as audio unit */
+ switch (st->codec->codec_id) {
+ case AV_CODEC_ID_MP2:
+ case AV_CODEC_ID_MP3:
+ st->need_parsing = AVSTREAM_PARSE_FULL;
+ break;
+ }
+ }
}
switch (st->codec->codec_id) {
@@ -1695,7 +1704,6 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
case AV_CODEC_ID_MP3:
/* force type after stsd for m1a hdlr */
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->need_parsing = AVSTREAM_PARSE_FULL;
break;
case AV_CODEC_ID_GSM:
case AV_CODEC_ID_ADPCM_MS: