diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-04 02:03:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-04 04:26:04 +0100 |
commit | 15c6be8c7da7b94b5e131396e9a82ab6fe4a6b64 (patch) | |
tree | 84db7f4851faba26561f846b4f112ef64d01b3ad /libavformat/electronicarts.c | |
parent | f972193a15026a99eb2b08e7913a03f2123663da (diff) | |
parent | b7beabab4b78cc253d06c0a33f15b8ff79866e85 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
tiertexseq: set correct block_align for audio
tiertexseq: set audio stream start time to 0
voc/avs: Do not change the sample rate mid-stream.
segafilm: use the sample rate as the time base for audio streams
ea: fix audio pts
psx-str: fix audio pts
vqf: set packet duration
tta demuxer: set packet duration
mpegaudio_parser: do not ignore information from the first parsed frame
mpegaudio_parser: be less picky about the start position
thp: set audio packet durations
avcodec: add a Vorbis parser to get packet duration
vorbisdec: read the previous window flag for long windows
lavc: free the output packet when encoding failed or produced no output.
lavc: preserve avpkt->destruct in ff_alloc_packet().
lavc: clarify the meaning of AVCodecContext.frame_number.
mpegts: Pad the packet buffer in handle_packet().
mpegts: Do not call read_sl_header() when no bytes remain in the buffer.
Conflicts:
libavcodec/mpegaudio_parser.c
libavcodec/version.h
libavformat/mpegts.c
tests/ref/fate/pva-demux
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r-- | libavformat/electronicarts.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 9719c6711a..968682af7e 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -70,7 +70,6 @@ typedef struct EaDemuxContext { enum CodecID audio_codec; int audio_stream_index; - int audio_frame_counter; int bytes; int sample_rate; @@ -472,7 +471,7 @@ static int ea_read_header(AVFormatContext *s) st->codec->bits_per_coded_sample / 4; st->codec->block_align = st->codec->channels*st->codec->bits_per_coded_sample; ea->audio_stream_index = st->index; - ea->audio_frame_counter = 0; + st->start_time = 0; } return 1; @@ -522,24 +521,26 @@ static int ea_read_packet(AVFormatContext *s, if (ret < 0) return ret; pkt->stream_index = ea->audio_stream_index; - pkt->pts = 90000; - 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; + case CODEC_ID_ADPCM_EA_R1: + case CODEC_ID_ADPCM_EA_R2: + case CODEC_ID_ADPCM_IMA_EA_EACS: + pkt->duration = AV_RL32(pkt->data); + break; + case CODEC_ID_ADPCM_EA_R3: + pkt->duration = AV_RB32(pkt->data); + break; + case CODEC_ID_ADPCM_IMA_EA_SEAD: + pkt->duration = ret * 2 / ea->num_channels; break; case CODEC_ID_PCM_S16LE_PLANAR: case CODEC_ID_MP3: - ea->audio_frame_counter += num_samples; + pkt->duration = num_samples; break; default: - ea->audio_frame_counter += chunk_size / - (ea->bytes * ea->num_channels); + pkt->duration = chunk_size / (ea->bytes * ea->num_channels); } packet_read = 1; |