mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
fftools/ffmpeg_filter: only use fallback parameters when necessary
With complex filtergraphs it can happen that the filtergraph is unconfigured because some other filter than the one we just got EOF on is missing parameters. Make sure that the fallback parametes for a given input are only used when that input is unconfigured.
This commit is contained in:
parent
65f3d042a6
commit
a16d7171d1
@ -1521,17 +1521,19 @@ int ifilter_send_eof(InputFilter *ifilter, int64_t pts, AVRational tb)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
// the filtergraph was never configured, use the fallback parameters
|
if (ifilter->format < 0) {
|
||||||
ifilter->format = ifp->fallback.format;
|
// the filtergraph was never configured, use the fallback parameters
|
||||||
ifilter->sample_rate = ifp->fallback.sample_rate;
|
ifilter->format = ifp->fallback.format;
|
||||||
ifilter->width = ifp->fallback.width;
|
ifilter->sample_rate = ifp->fallback.sample_rate;
|
||||||
ifilter->height = ifp->fallback.height;
|
ifilter->width = ifp->fallback.width;
|
||||||
ifilter->sample_aspect_ratio = ifp->fallback.sample_aspect_ratio;
|
ifilter->height = ifp->fallback.height;
|
||||||
|
ifilter->sample_aspect_ratio = ifp->fallback.sample_aspect_ratio;
|
||||||
|
|
||||||
ret = av_channel_layout_copy(&ifilter->ch_layout,
|
ret = av_channel_layout_copy(&ifilter->ch_layout,
|
||||||
&ifp->fallback.ch_layout);
|
&ifp->fallback.ch_layout);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (ifilter->format < 0 && (ifilter->type == AVMEDIA_TYPE_AUDIO || ifilter->type == AVMEDIA_TYPE_VIDEO)) {
|
if (ifilter->format < 0 && (ifilter->type == AVMEDIA_TYPE_AUDIO || ifilter->type == AVMEDIA_TYPE_VIDEO)) {
|
||||||
av_log(NULL, AV_LOG_ERROR, "Cannot determine format of input stream %d:%d after EOF\n", ifilter->ist->file_index, ifilter->ist->st->index);
|
av_log(NULL, AV_LOG_ERROR, "Cannot determine format of input stream %d:%d after EOF\n", ifilter->ist->file_index, ifilter->ist->st->index);
|
||||||
|
Loading…
Reference in New Issue
Block a user