mirror of https://git.ffmpeg.org/ffmpeg.git
fftools/ffmpeg: move decoder existence check to a more appropriate place
This commit is contained in:
parent
217b8757db
commit
b2a0a2e6f5
|
@ -898,13 +898,6 @@ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx,
|
|||
const AVCodec *codec = ist->dec;
|
||||
int ret;
|
||||
|
||||
if (!codec) {
|
||||
av_log(ist, AV_LOG_ERROR,
|
||||
"Decoding requested, but no decoder found for: %s\n",
|
||||
avcodec_get_name(ist->par->codec_id));
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
ret = dec_alloc(&ist->decoder);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
|
@ -866,6 +866,13 @@ static int ist_use(InputStream *ist, int decoding_needed)
|
|||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (decoding_needed && !ist->dec) {
|
||||
av_log(ist, AV_LOG_ERROR,
|
||||
"Decoding requested, but no decoder found for: %s\n",
|
||||
avcodec_get_name(ist->par->codec_id));
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (ds->sch_idx_stream < 0) {
|
||||
ret = sch_add_demux_stream(d->sch, d->f.index);
|
||||
if (ret < 0)
|
||||
|
|
Loading…
Reference in New Issue