aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/electronicarts.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2012-11-10 10:27:36 +1100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-11 12:52:02 +0100
commit6f78ba8b0b40ce0f4daea4fa6659cdc52bbce400 (patch)
tree7f6ed8a1d24e6243744e1901dee417c2a35dc2ba /libavformat/electronicarts.c
parentd168fcb68f2b8e416e5ad9cb74d42daf44e4598a (diff)
downloadffmpeg-6f78ba8b0b40ce0f4daea4fa6659cdc52bbce400.tar.gz
electronic arts: support rare samples containing adpcm_ea_r1 audio
Fixes ticket #1549. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r--libavformat/electronicarts.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 0847a3accb..82bc0e246d 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -189,7 +189,16 @@ static int process_audio_header_elements(AVFormatContext *s)
}
switch (revision2) {
case 8: ea->audio_codec = AV_CODEC_ID_PCM_S16LE_PLANAR; break;
- case 10: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R2; break;
+ case 10:
+ switch (revision) {
+ case -1:
+ case 2: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R1; break;
+ case 3: ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R2; break;
+ default:
+ av_log_ask_for_sample(s, "unsupported stream type; revision=%i, revision2=%i\n", revision, revision2);
+ return 0;
+ }
+ break;
case 16: ea->audio_codec = AV_CODEC_ID_MP3; break;
case -1: break;
default: