vlc | branch: master | Salah-Eddin Shaban <[email protected]> | Sat Feb  4 
01:07:33 2017 +0200| [7e8b50a23c8cc6a805461bdc629ac3b0d0e5a8e6] | committer: 
Jean-Baptiste Kempf

DirectShow: Check for IMediaControl::Run failure

Close #9161

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

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

 modules/access/dshow/dshow.cpp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 50f544d..f5c60ef 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -673,7 +673,12 @@ static int DemuxOpen( vlc_object_t *p_this )
 
     /* Everything is ready. Let's rock baby */
     msg_Dbg( p_this, "Playing...");
-    p_sys->p_control->Run();
+    if( FAILED( p_sys->p_control->Run() ) )
+    {
+        msg_Err( p_this, "Failed to run graph. Capture device may be in use." 
);
+        CommonClose( p_this, p_sys );
+        return VLC_EGENERIC;
+    }
 
     p_demux->pf_demux   = Demux;
     p_demux->pf_control = DemuxControl;
@@ -779,7 +784,12 @@ static int AccessOpen( vlc_object_t *p_this )
 
     /* Everything is ready. Let's rock baby */
     msg_Dbg( p_this, "Playing...");
-    p_sys->p_control->Run();
+    if( FAILED( p_sys->p_control->Run() ) )
+    {
+        msg_Err( p_this, "Failed to run graph. Capture device may be in use." 
);
+        CommonClose( p_this, p_sys );
+        return VLC_EGENERIC;
+    }
 
     return VLC_SUCCESS;
 }

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to