diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-08-01 15:57:31 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2013-01-09 14:49:06 -0500 |
commit | 12c2530b1d87fa94f81ea97df575b77c825e6f4f (patch) | |
tree | 95f72618008ba3c16ed506ce8e789c15fdb6fd2e /libavformat/idcin.c | |
parent | b0c96e06134d5c2aa3fa4f0951834c982ee99e3b (diff) | |
download | ffmpeg-12c2530b1d87fa94f81ea97df575b77c825e6f4f.tar.gz |
idcin: fix check for presence of an audio stream
Diffstat (limited to 'libavformat/idcin.c')
-rw-r--r-- | libavformat/idcin.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/idcin.c b/libavformat/idcin.c index 6b107b9904..aa196c8b49 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -170,6 +170,10 @@ static int idcin_read_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "invalid channels: %u\n", channels); return AVERROR_INVALIDDATA; } + idcin->audio_present = 1; + } else { + /* if sample rate is 0, assume no audio */ + idcin->audio_present = 0; } st = avformat_new_stream(s, NULL); @@ -190,8 +194,7 @@ static int idcin_read_header(AVFormatContext *s) HUFFMAN_TABLE_SIZE) return AVERROR(EIO); - /* if sample rate is 0, assume no audio */ - if (sample_rate) { + if (idcin->audio_present) { idcin->audio_present = 1; st = avformat_new_stream(s, NULL); if (!st) @@ -220,8 +223,7 @@ static int idcin_read_header(AVFormatContext *s) (sample_rate / 14) * bytes_per_sample * channels; } idcin->current_audio_chunk = 0; - } else - idcin->audio_present = 1; + } idcin->next_chunk_is_video = 1; idcin->pts = 0; |