[vlc-commits] Handle errors when no filter can be found to adapt from the decoder format to the display one .

Laurent Aimar git at videolan.org
Sat Feb 12 20:05:47 CET 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Feb 12 19:59:06 2011 +0100| [174ded88c536ffc9f9eeb8de96e29cf5e9c9a889] | committer: Laurent Aimar

Handle errors when no filter can be found to adapt from the decoder format to the display one.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=174ded88c536ffc9f9eeb8de96e29cf5e9c9a889
---

 src/video_output/display.c      |   10 +++++-----
 src/video_output/video_output.c |    2 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 94da01b..9ca692b 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -424,11 +424,7 @@ static void VoutDisplayCreateRender(vout_display_t *vd)
             break;
     }
     if (!filter)
-    {
-        msg_Err(vd, "VoutDisplayCreateRender FAILED");
-        /* TODO */
-        assert(0);
-    }
+        msg_Err(vd, "Failed to adapt decoder format to display");
 }
 
 static void VoutDisplayDestroyRender(vout_display_t *vd)
@@ -1087,6 +1083,10 @@ picture_t *vout_FilterDisplay(vout_display_t *vd, picture_t *picture)
     vout_display_owner_sys_t *osys = vd->owner.sys;
 
     assert(osys->filters);
+    if (filter_chain_GetLength(osys->filters) <= 0) {
+        picture_Release(picture);
+        return NULL;
+    }
     return filter_chain_VideoFilter(osys->filters, picture);
 }
 
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 351a9fa..17e3391 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1020,6 +1020,8 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
         }
         if (!do_dr_spu && subpic)
             subpicture_Delete(subpic);
+        if (!sys->display.filtered)
+            return VLC_EGENERIC;
     }
 
     vout_chrono_Stop(&vout->p->render);



More information about the vlc-commits mailing list