Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-03-26 18:16:07 +0400
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-03-27 03:50:39 +0400
commit9ecfd7daa37d84209b5e47b9fdd3cdb88d197203 (patch)
treeb17ea9bce74b3e01f3b3de57f728ec3b921f3294 /libavformat
parent90f1aa38b6664b9c260b4c7bda5df49e38b964bc (diff)
Only test the first frame for missing aac_adtstoasc bistream filter.
Many players ignore broken aac frames, so don't abort mov or flv muxing when encountering one, just print a warning instead. Fixes ticket #2380. (cherry picked from commit 1741fece7073f51efdd837a4f307ea2cdf3d1cfb)
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flvenc.c3
-rw-r--r--libavformat/movenc.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 502da0f0c5..e1dd43f716 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -493,10 +493,13 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
} else if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
+ if (!s->streams[pkt->stream_index]->nb_frames) {
av_log(s, AV_LOG_ERROR, "Malformed AAC bitstream detected: "
"use audio bitstream filter 'aac_adtstoasc' to fix it "
"('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
return AVERROR_INVALIDDATA;
+ }
+ av_log(s, AV_LOG_WARNING, "aac bitstream error\n");
}
if (flv->delay == AV_NOPTS_VALUE)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 42496b57e9..47dde94fd2 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3185,8 +3185,11 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
}
} else if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
+ if (!s->streams[pkt->stream_index]->nb_frames) {
av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
return -1;
+ }
+ av_log(s, AV_LOG_WARNING, "aac bitstream error\n");
} else {
avio_write(pb, pkt->data, size);
}