# HG changeset patch # User aurel # Date 1192750803 0 # Node ID 3ffeea972e03e7468d76a6deafe172f86bc915ee # Parent 6a53777da0c997f1829f06413b0cc02b9dffc5cf compute pts according to the audio codec diff -r 6a53777da0c9 -r 3ffeea972e03 electronicarts.c --- a/electronicarts.c Thu Oct 18 23:36:12 2007 +0000 +++ b/electronicarts.c Thu Oct 18 23:40:03 2007 +0000 @@ -304,10 +304,17 @@ 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;