[vlc-commits] commit: DShow: small fixes on error paths (Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Mon Aug 9 20:36:35 CEST 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Aug  9 19:55:34 2010 +0200| [d475b82a023d7016dba778ea1110999c8c953277] | committer: Jean-Baptiste Kempf 

DShow: small fixes on error paths

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

 modules/access/dshow/common.h  |    2 +-
 modules/access/dshow/dshow.cpp |   12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/access/dshow/common.h b/modules/access/dshow/common.h
index b08b1a8..573db27 100644
--- a/modules/access/dshow/common.h
+++ b/modules/access/dshow/common.h
@@ -105,7 +105,7 @@ struct access_sys_t
 /*****************************************************************************
  * DirectShow GUIDs.
  *****************************************************************************/
-const GUID PROPSETID_TUNER = {0x6a2e0605, 0x28e4, 0x11d0, {0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56}};
+static const GUID PROPSETID_TUNER = {0x6a2e0605, 0x28e4, 0x11d0, {0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56}};
 
 /****************************************************************************
  * The following should be in ks.h and ksmedia.h, but since they are not in
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 6b0d67c..b61769e 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -2326,6 +2326,7 @@ static void ConfigTuner( vlc_object_t *p_this, ICaptureGraphBuilder2 *p_graph,
         if (FAILED(hr))
         {
             msg_Dbg( p_this, "Couldn't QI for IKsPropertySet" );
+            p_TV->Release();
             return;
         }
 
@@ -2349,7 +2350,7 @@ static void ConfigTuner( vlc_object_t *p_this, ICaptureGraphBuilder2 *p_graph,
         else
         {
             msg_Dbg( p_this, "KSPROPERTY_TUNER_MODE_CAPS not supported!" );
-            return;
+            goto free_on_error;
         }
 
         msg_Dbg( p_this, "Frequency range supproted from %d to %d.", ModeCaps.MinFrequency, ModeCaps.MaxFrequency);
@@ -2378,13 +2379,13 @@ static void ConfigTuner( vlc_object_t *p_this, ICaptureGraphBuilder2 *p_graph,
                 if(FAILED(hr))
                 {
                     msg_Dbg( p_this, "Couldn't set KSPROPERTY_TUNER_FREQUENCY!" );
-                    return;
+                    goto free_on_error;
                 }
             }
             else
             {
                 msg_Dbg( p_this, "Requested frequency exceeds the supported range!" );
-                return;
+                goto free_on_error;
             }
         }
 
@@ -2401,15 +2402,16 @@ static void ConfigTuner( vlc_object_t *p_this, ICaptureGraphBuilder2 *p_graph,
                 if(FAILED(hr))
                 {
                     msg_Dbg( p_this, "Couldn't set KSPROPERTY_TUNER_STANDARD!" );
-                    return;
+                    goto free_on_error;
                 }
             }
             else
             {
                 msg_Dbg( p_this, "Requested video standard is not supported by the tuner!" );
-                return;
+                goto free_on_error;
             }
         }
+free_on_error:
         pKs->Release();
     }
 



More information about the vlc-commits mailing list