aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-23 01:16:57 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-23 01:22:16 +0200
commit697b476c075a0330c9ea058b5e74e970d1095adb (patch)
tree72df9b9d2d2e73ea945e15f20e0ff4b3c0f07b83
parenta9f522d1b73f3726cc25c7daffcfccac94eee297 (diff)
downloadffmpeg-697b476c075a0330c9ea058b5e74e970d1095adb.tar.gz
wav: Fix DTS detection
Fixes Ticket1474 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/wav.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/wav.c b/libavformat/wav.c
index 5518ff3930..f58bcb32ad 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -276,6 +276,14 @@ static int wav_probe(AVProbeData *p)
return 0;
}
+static void handle_stream_probing(AVStream *st)
+{
+ if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
+ st->request_probe = AVPROBE_SCORE_MAX/2;
+ st->probe_packets = FFMIN(st->probe_packets, 4);
+ }
+}
+
static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
{
AVIOContext *pb = s->pb;
@@ -289,6 +297,8 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
ret = ff_get_wav_header(pb, (*st)->codec, size);
if (ret < 0)
return ret;
+ handle_stream_probing(*st);
+
(*st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
avpriv_set_pts_info(*st, 64, 1, (*st)->codec->sample_rate);
@@ -771,6 +781,7 @@ static int w64_read_header(AVFormatContext *s)
return ret;
avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
+ handle_stream_probing(st);
st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);