diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-01-11 21:10:35 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-03 17:03:27 -0500 |
commit | 0883109b27a9d2edf9528506e2605a5e0b8eef95 (patch) | |
tree | 62c1251ebbc30f2606f1d3681e5acabefbac0906 /libavformat | |
parent | 4da374f8a9bc7cf790e6f5b30af3a30f0b777348 (diff) | |
download | ffmpeg-0883109b27a9d2edf9528506e2605a5e0b8eef95.tar.gz |
voc/avs: Do not change the sample rate mid-stream.
Also, set the time base based on the sample rate.
lavf-voc seek test updated to reflect slightly different seek points.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/vocdec.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c index e8c11afbe3..3c27062408 100644 --- a/libavformat/vocdec.c +++ b/libavformat/vocdec.c @@ -86,9 +86,13 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) switch (type) { case VOC_TYPE_VOICE_DATA: - dec->sample_rate = 1000000 / (256 - avio_r8(pb)); - if (sample_rate) - dec->sample_rate = sample_rate; + if (!dec->sample_rate) { + dec->sample_rate = 1000000 / (256 - avio_r8(pb)); + if (sample_rate) + dec->sample_rate = sample_rate; + avpriv_set_pts_info(st, 64, 1, dec->sample_rate); + } else + avio_skip(pb, 1); dec->channels = channels; tmp_codec = avio_r8(pb); dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id); @@ -110,7 +114,11 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) break; case VOC_TYPE_NEW_VOICE_DATA: - dec->sample_rate = avio_rl32(pb); + if (!dec->sample_rate) { + dec->sample_rate = avio_rl32(pb); + avpriv_set_pts_info(st, 64, 1, dec->sample_rate); + } else + avio_skip(pb, 4); dec->bits_per_coded_sample = avio_r8(pb); dec->channels = avio_r8(pb); tmp_codec = avio_rl16(pb); |