aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/electronicarts.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2007-10-18 23:40:03 +0000
committerAurelien Jacobs <aurel@gnuage.org>2007-10-18 23:40:03 +0000
commit200f41ad2ecf3d5dbc017c16be4d7ef35fdc7de7 (patch)
tree9d7f2bc2c0ef05058faa60352d4cad22e286d214 /libavformat/electronicarts.c
parentffbd0bcdb6a122a240d178fe494ee0cf4d9aea5e (diff)
downloadffmpeg-200f41ad2ecf3d5dbc017c16be4d7ef35fdc7de7.tar.gz
compute pts according to the audio codec
Originally committed as revision 10803 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r--libavformat/electronicarts.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 02099545f4..fadf2fbaa4 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -304,10 +304,17 @@ static int ea_read_packet(AVFormatContext *s,
pkt->pts *= ea->audio_frame_counter;
pkt->pts /= ea->sample_rate;
+ switch (ea->audio_codec) {
+ case CODEC_ID_ADPCM_EA:
/* 2 samples/byte, 1 or 2 samples per frame depending
* on stereo; chunk also has 12-byte header */
ea->audio_frame_counter += ((chunk_size - 12) * 2) /
ea->num_channels;
+ break;
+ default:
+ ea->audio_frame_counter += chunk_size /
+ (ea->bytes * ea->num_channels);
+ }
}
packet_read = 1;