Browse Source

compute pts according to the audio codec

Originally committed as revision 10803 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Aurelien Jacobs 18 years ago
parent
commit
200f41ad2e
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libavformat/electronicarts.c

+ 7
- 0
libavformat/electronicarts.c View File

@@ -304,10 +304,17 @@ static int ea_read_packet(AVFormatContext *s,
pkt->pts *= ea->audio_frame_counter; pkt->pts *= ea->audio_frame_counter;
pkt->pts /= ea->sample_rate; pkt->pts /= ea->sample_rate;


switch (ea->audio_codec) {
case CODEC_ID_ADPCM_EA:
/* 2 samples/byte, 1 or 2 samples per frame depending /* 2 samples/byte, 1 or 2 samples per frame depending
* on stereo; chunk also has 12-byte header */ * on stereo; chunk also has 12-byte header */
ea->audio_frame_counter += ((chunk_size - 12) * 2) / ea->audio_frame_counter += ((chunk_size - 12) * 2) /
ea->num_channels; ea->num_channels;
break;
default:
ea->audio_frame_counter += chunk_size /
(ea->bytes * ea->num_channels);
}
} }


packet_read = 1; packet_read = 1;


Loading…
Cancel
Save