mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
idcin: fix check for presence of an audio stream
This commit is contained in:
parent
b0c96e0613
commit
12c2530b1d
@ -170,6 +170,10 @@ static int idcin_read_header(AVFormatContext *s)
|
|||||||
av_log(s, AV_LOG_ERROR, "invalid channels: %u\n", channels);
|
av_log(s, AV_LOG_ERROR, "invalid channels: %u\n", channels);
|
||||||
return AVERROR_INVALIDDATA;
|
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);
|
st = avformat_new_stream(s, NULL);
|
||||||
@ -190,8 +194,7 @@ static int idcin_read_header(AVFormatContext *s)
|
|||||||
HUFFMAN_TABLE_SIZE)
|
HUFFMAN_TABLE_SIZE)
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
|
||||||
/* if sample rate is 0, assume no audio */
|
if (idcin->audio_present) {
|
||||||
if (sample_rate) {
|
|
||||||
idcin->audio_present = 1;
|
idcin->audio_present = 1;
|
||||||
st = avformat_new_stream(s, NULL);
|
st = avformat_new_stream(s, NULL);
|
||||||
if (!st)
|
if (!st)
|
||||||
@ -220,8 +223,7 @@ static int idcin_read_header(AVFormatContext *s)
|
|||||||
(sample_rate / 14) * bytes_per_sample * channels;
|
(sample_rate / 14) * bytes_per_sample * channels;
|
||||||
}
|
}
|
||||||
idcin->current_audio_chunk = 0;
|
idcin->current_audio_chunk = 0;
|
||||||
} else
|
}
|
||||||
idcin->audio_present = 1;
|
|
||||||
|
|
||||||
idcin->next_chunk_is_video = 1;
|
idcin->next_chunk_is_video = 1;
|
||||||
idcin->pts = 0;
|
idcin->pts = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user