Mercurial > libavformat.hg
comparison electronicarts.c @ 2643:3ffeea972e03 libavformat
compute pts according to the audio codec
author | aurel |
---|---|
date | Thu, 18 Oct 2007 23:40:03 +0000 |
parents | 6a53777da0c9 |
children | ad769d06b84c |
comparison
equal
deleted
inserted
replaced
2642:6a53777da0c9 | 2643:3ffeea972e03 |
---|---|
302 pkt->stream_index = ea->audio_stream_index; | 302 pkt->stream_index = ea->audio_stream_index; |
303 pkt->pts = 90000; | 303 pkt->pts = 90000; |
304 pkt->pts *= ea->audio_frame_counter; | 304 pkt->pts *= ea->audio_frame_counter; |
305 pkt->pts /= ea->sample_rate; | 305 pkt->pts /= ea->sample_rate; |
306 | 306 |
307 switch (ea->audio_codec) { | |
308 case CODEC_ID_ADPCM_EA: | |
307 /* 2 samples/byte, 1 or 2 samples per frame depending | 309 /* 2 samples/byte, 1 or 2 samples per frame depending |
308 * on stereo; chunk also has 12-byte header */ | 310 * on stereo; chunk also has 12-byte header */ |
309 ea->audio_frame_counter += ((chunk_size - 12) * 2) / | 311 ea->audio_frame_counter += ((chunk_size - 12) * 2) / |
310 ea->num_channels; | 312 ea->num_channels; |
313 break; | |
314 default: | |
315 ea->audio_frame_counter += chunk_size / | |
316 (ea->bytes * ea->num_channels); | |
317 } | |
311 } | 318 } |
312 | 319 |
313 packet_read = 1; | 320 packet_read = 1; |
314 break; | 321 break; |
315 | 322 |