]> git.sesse.net Git - vlc/commitdiff
Fixed filter_chain_GetFmtOut to really return the output value when
authorLaurent Aimar <fenrir@videolan.org>
Sun, 3 Aug 2008 12:54:44 +0000 (14:54 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 3 Aug 2008 12:56:03 +0000 (14:56 +0200)
possible.

src/misc/filter_chain.c

index 5397b067a7d600e8a6393d3a00e4f2a52fe1e161..a89c288d6f1ec809205d0107313ead77b274aeef 100644 (file)
@@ -328,7 +328,18 @@ int filter_chain_GetLength( filter_chain_t *p_chain )
 
 const es_format_t *filter_chain_GetFmtOut( filter_chain_t *p_chain )
 {
-    return &p_chain->fmt_out;
+
+    if( p_chain->b_allow_fmt_out_change )
+        return &p_chain->fmt_out;
+
+    /* Unless filter_chain_Reset has been called we are doomed */
+    if( p_chain->filters.i_count <= 0 )
+        return &p_chain->fmt_out;
+
+    /* */
+    filter_t *p_last = (filter_t*)p_chain->filters.pp_elems[p_chain->filters.i_count-1];
+
+    return &p_last->fmt_out;
 }
 
 /**