diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-01-11 11:07:40 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-03 17:03:27 -0500 |
commit | 4da374f8a9bc7cf790e6f5b30af3a30f0b777348 (patch) | |
tree | 755eeab7018c8fb5442e276b925a17679d50b597 /libavformat | |
parent | ea289186f04fa8b9f2cc3bc1aba1cb239ab56f47 (diff) | |
download | ffmpeg-4da374f8a9bc7cf790e6f5b30af3a30f0b777348.tar.gz |
segafilm: use the sample rate as the time base for audio streams
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/segafilm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index 83ba4f06ad..23cb3ed1ed 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -196,8 +196,13 @@ static int film_read_header(AVFormatContext *s) if (!film->sample_table) return AVERROR(ENOMEM); - for(i=0; i<s->nb_streams; i++) - avpriv_set_pts_info(s->streams[i], 33, 1, film->base_clock); + for (i = 0; i < s->nb_streams; i++) { + st = s->streams[i]; + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) + avpriv_set_pts_info(st, 33, 1, film->base_clock); + else + avpriv_set_pts_info(st, 64, 1, film->audio_samplerate); + } audio_frame_counter = 0; for (i = 0; i < film->sample_count; i++) { @@ -212,8 +217,6 @@ static int film_read_header(AVFormatContext *s) if (AV_RB32(&scratch[8]) == 0xFFFFFFFF) { film->sample_table[i].stream = film->audio_stream_index; film->sample_table[i].pts = audio_frame_counter; - film->sample_table[i].pts *= film->base_clock; - film->sample_table[i].pts /= film->audio_samplerate; if (film->audio_type == CODEC_ID_ADPCM_ADX) audio_frame_counter += (film->sample_table[i].sample_size * 32 / |