# HG changeset patch # User aurel # Date 1192748017 0 # Node ID b8f97bf41cc37d3dd2aea4957f076dac4501fddd # Parent 3b95556c8cd41b5776f43a31e366374941e32358 check compression_type to assign audio codec diff -r 3b95556c8cd4 -r b8f97bf41cc3 electronicarts.c --- a/electronicarts.c Thu Oct 18 22:47:56 2007 +0000 +++ b/electronicarts.c Thu Oct 18 22:53:37 2007 +0000 @@ -82,7 +82,7 @@ int inHeader = 1; EaDemuxContext *ea = s->priv_data; ByteIOContext *pb = &s->pb; - int compression_type; + int compression_type = -1; ea->num_channels = 1; @@ -138,7 +138,12 @@ } } - ea->audio_codec = CODEC_ID_ADPCM_EA; + switch (compression_type) { + case 7: ea->audio_codec = CODEC_ID_ADPCM_EA; break; + default: + av_log(s, AV_LOG_ERROR, "unsupported stream type; compression_type=%i\n", compression_type); + return 0; + } return 1; }