Mercurial > libavformat.hg
changeset 2780:0b9d29522781 libavformat
add pcm_s16le_planar support for electronicarts files
author | aurel |
---|---|
date | Sun, 25 Nov 2007 16:32:47 +0000 |
parents | 149800f1778e |
children | ef97cb4269d8 |
files | electronicarts.c |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/electronicarts.c Sat Nov 24 10:08:02 2007 +0000 +++ b/electronicarts.c Sun Nov 25 16:32:47 2007 +0000 @@ -91,7 +91,7 @@ int inHeader = 1; EaDemuxContext *ea = s->priv_data; ByteIOContext *pb = s->pb; - int compression_type = -1, revision = -1; + int compression_type = -1, revision = -1, revision2 = -1; ea->bytes = 2; ea->sample_rate = -1; @@ -136,6 +136,10 @@ av_log (s, AV_LOG_INFO, "exited audio subheader\n"); inSubheader = 0; break; + case 0xA0: + revision2 = read_arbitary(pb); + av_log (s, AV_LOG_INFO, "revision2 (element 0xA0) set to 0x%08x\n", revision2); + break; case 0xFF: av_log (s, AV_LOG_INFO, "end of header block reached (within audio subheader)\n"); inSubheader = 0; @@ -165,10 +169,17 @@ case 1: ea->audio_codec = CODEC_ID_ADPCM_EA_R1; break; case 2: ea->audio_codec = CODEC_ID_ADPCM_EA_R2; break; case 3: ea->audio_codec = CODEC_ID_ADPCM_EA_R3; break; + case -1: break; default: av_log(s, AV_LOG_ERROR, "unsupported stream type; revision=%i\n", revision); return 0; } + switch (revision2) { + case 8: ea->audio_codec = CODEC_ID_PCM_S16LE_PLANAR; break; + default: + av_log(s, AV_LOG_ERROR, "unsupported stream type; revision2=%i\n", revision2); + return 0; + } break; default: av_log(s, AV_LOG_ERROR, "unsupported stream type; compression_type=%i\n", compression_type); @@ -392,6 +403,9 @@ if (!ea->audio_codec) { url_fskip(pb, chunk_size); break; + } else if (ea->audio_codec == CODEC_ID_PCM_S16LE_PLANAR) { + url_fskip(pb, 12); /* planar header */ + chunk_size -= 12; } ret = av_get_packet(pb, pkt, chunk_size); if (ret != chunk_size)