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 04:09:02 +0400
commit402bc31d87871a8a87056c51f58cc21841a29c6f (patch)
tree3d27fb6954fef4fd6afc4142aa64d49804825467
parent8b597077ae1b59a29350b96683cd406cfc4f801d (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) Conflicts: libavformat/flvenc.c libavformat/movenc.c
-rw-r--r--libavformat/flvenc.c9
-rw-r--r--libavformat/movenc.c3
2 files changed, 10 insertions, 2 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 2f5aa28e6a..e874e14778 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -446,8 +446,13 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
}
} else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
- av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
- return -1;
+ 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)
flv->delay = -pkt->dts;
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 420e5f8403..1526944a53 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2264,8 +2264,11 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
} else if (enc->codec_id == 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 if (mov->frag_seq_num>0){
trk->cluster[trk->entry].data = av_malloc(size);
if (!trk->cluster[trk->entry].data)