]> git.sesse.net Git - vlc/blobdiff - modules/access/dshow/dshow.cpp
Do not leak psz_demux
[vlc] / modules / access / dshow / dshow.cpp
index 53db60c2755b5861288e93cc7e2baf2f188b5622..ee28b8612158d782c3eeb0ad6296bdf9c8673c08 100644 (file)
@@ -34,6 +34,7 @@
 #include <inttypes.h>
 
 #include <vlc/vlc.h>
+#include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_access.h>
 #include <vlc_demux.h>
@@ -418,7 +419,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
     p_sys->p_capture_graph_builder2 = NULL;
     p_sys->p_control = NULL;
 
-    vlc_mutex_init( p_this, &p_sys->lock );
+    vlc_mutex_init( &p_sys->lock );
     vlc_cond_init( p_this, &p_sys->wait );
 
     /* Build directshow graph */
@@ -656,11 +657,13 @@ static int AccessOpen( vlc_object_t *p_this )
             p_stream->i_fourcc == VLC_FOURCC('d','v','s','d') ||
             p_stream->i_fourcc == VLC_FOURCC('d','v','h','d') )
         {
+            free( p_access->psz_demux );
             p_access->psz_demux = strdup( "rawdv" );
         }
         else if( p_stream->i_fourcc == VLC_FOURCC('m','p','2','v') )
         {
-            p_access->psz_demux = "mpgv";
+            free( p_access->psz_demux );
+            p_access->psz_demux = strdup( "mpgv" );
         }
     }