[FFmpeg-cvslog] ffmpeg: set the source_index for trivial filter graphs

Michael Niedermayer git at videolan.org
Fri Oct 11 01:13:29 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Oct 11 00:33:25 2013 +0200| [a72bf5fd118831d547786e353bd1377ddcbc8073] | committer: Michael Niedermayer

ffmpeg: set the source_index for trivial filter graphs

Fixes one testcase in Ticket2969

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a72bf5fd118831d547786e353bd1377ddcbc8073
---

 ffmpeg.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index d7bcb78..86b7162 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2104,6 +2104,21 @@ static int transcode_init(void)
     char error[1024];
     int want_sdp = 1;
 
+    for (i = 0; i < nb_filtergraphs; i++) {
+        FilterGraph *fg = filtergraphs[i];
+        for (j = 0; j < fg->nb_outputs; j++) {
+            OutputFilter *ofilter = fg->outputs[j];
+            if (ofilter->ost->source_index >= 0)
+                continue;
+            if (fg->nb_inputs != 1)
+                continue;
+            for (k = nb_input_streams-1; k >= 0 ; k--)
+                if (fg->inputs[0]->ist == input_streams[k])
+                    break;
+            ofilter->ost->source_index = k;
+        }
+    }
+
     /* init framerate emulation */
     for (i = 0; i < nb_input_files; i++) {
         InputFile *ifile = input_files[i];



More information about the ffmpeg-cvslog mailing list