[SCM] libav/experimental: compute pts according to the audio codec
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 16:08:29 UTC 2013
The following commit has been merged in the experimental branch:
commit 200f41ad2ecf3d5dbc017c16be4d7ef35fdc7de7
Author: Aurelien Jacobs <aurel at gnuage.org>
Date: Thu Oct 18 23:40:03 2007 +0000
compute pts according to the audio codec
Originally committed as revision 10803 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 0209954..fadf2fb 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;
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list