diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2007-11-25 16:32:47 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2007-11-25 16:32:47 +0000 |
commit | 725d86bfd52fdecb4d24fc6c62201064071f4c82 (patch) | |
tree | db396edbc420ae29b15b217489af047727d7bc3c /libavformat/electronicarts.c | |
parent | 4d4f59d750b5b65cb37bc2242355ea3e41d7667c (diff) | |
download | ffmpeg-725d86bfd52fdecb4d24fc6c62201064071f4c82.tar.gz |
add pcm_s16le_planar support for electronicarts files
Originally committed as revision 11092 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r-- | libavformat/electronicarts.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 33f2cea481..0201e82004 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -91,7 +91,7 @@ static int process_audio_header_elements(AVFormatContext *s) 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 @@ static int process_audio_header_elements(AVFormatContext *s) 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 @@ static int process_audio_header_elements(AVFormatContext *s) 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 @@ static int ea_read_packet(AVFormatContext *s, 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) |