You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
fftools/ffmpeg_filter: allow binding unlabeled filtergraphs
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -1383,6 +1383,33 @@ static int fg_complex_bind_input(FilterGraph *fg, InputFilter *ifilter, int comm
|
|||||||
"Binding input with label '%s' to input stream %d:%d\n",
|
"Binding input with label '%s' to input stream %d:%d\n",
|
||||||
ifilter->linklabel, ist->file->index, ist->index);
|
ifilter->linklabel, ist->file->index, ist->index);
|
||||||
} else {
|
} else {
|
||||||
|
// try finding an unbound filtergraph output
|
||||||
|
for (int i = 0; i < nb_filtergraphs; i++) {
|
||||||
|
FilterGraph *fg_src = filtergraphs[i];
|
||||||
|
|
||||||
|
if (fg == fg_src)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (int j = 0; j < fg_src->nb_outputs; j++) {
|
||||||
|
OutputFilter *ofilter = fg_src->outputs[j];
|
||||||
|
|
||||||
|
if (!ofilter->bound) {
|
||||||
|
if (commit) {
|
||||||
|
av_log(fg, AV_LOG_VERBOSE,
|
||||||
|
"Binding unlabeled filtergraph input to filtergraph output %d:%d\n", i, j);
|
||||||
|
|
||||||
|
ret = ifilter_bind_fg(ifp, fg_src, j);
|
||||||
|
if (ret < 0) {
|
||||||
|
av_log(fg, AV_LOG_ERROR, "Error binding filtergraph input %d:%d\n", i, j);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
ofp_from_ofilter(ofilter)->needed = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ist = ist_find_unused(type);
|
ist = ist_find_unused(type);
|
||||||
if (!ist) {
|
if (!ist) {
|
||||||
av_log(fg, AV_LOG_FATAL,
|
av_log(fg, AV_LOG_FATAL,
|
||||||
|
|||||||
Reference in New Issue
Block a user