summaryrefslogtreecommitdiff
path: root/libavformat/electronicarts.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2011-01-10 12:51:45 +0000
committerPeter Ross <pross@xvid.org>2011-01-10 12:51:45 +0000
commit42396c2e67bec46c5842ace9c237469cde196b4e (patch)
treec32024d5b19f38ec681283b8ca65334a29d2d7bd /libavformat/electronicarts.c
parent94e58e5770d2a2295a13240f51ddba583e6d5360 (diff)
electronicarts: only apply audio sanity checks when audio stream is present
Originally committed as revision 26301 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r--libavformat/electronicarts.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index c39da1a8a0..27cd4a62db 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -422,17 +422,18 @@ static int ea_read_header(AVFormatContext *s,
st->codec->height = ea->height;
}
- if (ea->num_channels <= 0) {
- av_log(s, AV_LOG_WARNING, "Unsupported number of channels: %d\n", ea->num_channels);
- ea->audio_codec = 0;
- }
-
- if (ea->sample_rate <= 0) {
- av_log(s, AV_LOG_ERROR, "Unsupported sample rate: %d\n", ea->sample_rate);
- ea->audio_codec = 0;
- }
-
if (ea->audio_codec) {
+ if (ea->num_channels <= 0) {
+ av_log(s, AV_LOG_WARNING, "Unsupported number of channels: %d\n", ea->num_channels);
+ ea->audio_codec = 0;
+ return 1;
+ }
+ if (ea->sample_rate <= 0) {
+ av_log(s, AV_LOG_ERROR, "Unsupported sample rate: %d\n", ea->sample_rate);
+ ea->audio_codec = 0;
+ return 1;
+ }
+
/* initialize the audio decoder stream */
st = av_new_stream(s, 0);
if (!st)