diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-09 20:45:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-09 20:45:52 +0100 |
commit | c9afeda55ef29534d7b565bd613122227e046d5b (patch) | |
tree | 7b7af6b0b078da686d9e65982f54aeda26fc728d /libavformat | |
parent | 3a5cbc91a45a8524dcf8c68c6ab54412f95f87a2 (diff) | |
parent | 362383b743f3a379675ff4b310d357893a6a872e (diff) | |
download | ffmpeg-c9afeda55ef29534d7b565bd613122227e046d5b.tar.gz |
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
Fix remuxing of IMA_QT in mov.
Do not detect "00000000..." (and other non-changing values) as adp.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/adp.c | 11 | ||||
-rw-r--r-- | libavformat/movenc.c | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/libavformat/adp.c b/libavformat/adp.c index c5feac4fa5..08a4225e46 100644 --- a/libavformat/adp.c +++ b/libavformat/adp.c @@ -26,14 +26,21 @@ static int adp_probe(AVProbeData *p) { - int i; + int i, changes = 0; + char last = 0; if (p->buf_size < 32) return 0; - for (i = 0; i < p->buf_size - 3; i+=32) + for (i = 0; i < p->buf_size - 3; i+=32) { if (p->buf[i] != p->buf[i+2] || p->buf[i+1] != p->buf[i+3]) return 0; + if (p->buf[i] != last) + changes++; + last = p->buf[i]; + } + if (changes <= 1) + return 0; return p->buf_size < 260 ? 1 : AVPROBE_SCORE_MAX / 4; } diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 92ce5341e6..7315417ca2 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3885,7 +3885,8 @@ static int mov_write_header(AVFormatContext *s) }else{ track->sample_size = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels; } - if (st->codec->codec_id == AV_CODEC_ID_ILBC) { + if (st->codec->codec_id == AV_CODEC_ID_ILBC || + st->codec->codec_id == AV_CODEC_ID_ADPCM_IMA_QT) { track->audio_vbr = 1; } if (track->mode != MODE_MOV && |