diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-21 19:41:40 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-21 20:32:06 +0200 |
commit | ae215e2b42dd172f6bfd9f2dad44c9d5c11884bf (patch) | |
tree | 14ac07afbbba24d9d557d0e3893bdf3699c31619 | |
parent | 3bcf61f495dcadbc9679a00e6b1023531288498d (diff) | |
parent | 6ec688e1bc76dd93151cbca1c340162ae4b10d77 (diff) | |
download | ffmpeg-ae215e2b42dd172f6bfd9f2dad44c9d5c11884bf.tar.gz |
Merge commit '6ec688e1bc76dd93151cbca1c340162ae4b10d77'
* commit '6ec688e1bc76dd93151cbca1c340162ae4b10d77':
mp3: enable packed main_data decoding in MP4
Conflicts:
libavcodec/mpegaudiodec_template.c
Only the parts needed to support the available sample are merged
the remaining error checks are left in place
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpegaudiodec_template.c | 2 | ||||
-rw-r--r-- | libavformat/mov.c | 10 | ||||
-rw-r--r-- | tests/fate/mp3.mak | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 1cc5ac47f4..9081a3ca94 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -1686,7 +1686,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr, if (!avctx->bit_rate) avctx->bit_rate = s->bit_rate; - if (s->frame_size <= 0 || s->frame_size > buf_size) { + if (s->frame_size <= 0) { av_log(avctx, AV_LOG_ERROR, "incomplete frame\n"); return AVERROR_INVALIDDATA; } else if (s->frame_size < buf_size) { diff --git a/libavformat/mov.c b/libavformat/mov.c index 5ea6932801..47628165fd 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1669,6 +1669,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) { @@ -1889,7 +1898,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: diff --git a/tests/fate/mp3.mak b/tests/fate/mp3.mak index 57ee08414b..a7b46c0969 100644 --- a/tests/fate/mp3.mak +++ b/tests/fate/mp3.mak @@ -1,6 +1,6 @@ FATE_MP3 += fate-mp3-float-conf-compl fate-mp3-float-conf-compl: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/compl.bit -fate-mp3-float-conf-compl: REF = $(SAMPLES)/mp3-conformance/compl.pcm +fate-mp3-float-conf-compl: REF = $(SAMPLES)/mp3-conformance/compl_2.pcm FATE_MP3 += fate-mp3-float-conf-he_32khz fate-mp3-float-conf-he_32khz: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/he_32khz.bit -fs 343296 |