]> git.sesse.net Git - vlc/blobdiff - modules/misc/rtsp.c
vlc_plugin: fix non-LGPL plugins meta infos
[vlc] / modules / misc / rtsp.c
index 333d449d8d90d918647e8661dfdbaff2f0f1632b..6dc8119def1952ffe2860b592e6a0401ac999e92 100644 (file)
@@ -30,6 +30,7 @@
 # include "config.h"
 #endif
 
+#define VLC_MODULE_LICENSE VLC_LICENSE_GPL_2_PLUS
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_input.h>
@@ -73,7 +74,7 @@ static void Close( vlc_object_t * );
 
 vlc_module_begin ()
     set_shortname( N_("RTSP VoD" ) )
-    set_description( N_("RTSP VoD server") )
+    set_description( N_("Legacy RTSP VoD server") )
     set_category( CAT_SOUT )
     set_subcategory( SUBCAT_SOUT_VOD )
     set_capability( "vod server", 1 )
@@ -279,8 +280,6 @@ static int Open( vlc_object_t *p_this )
 
     p_sys->psz_path = strdup( url.psz_path ? url.psz_path : "/" );
 
-    vlc_UrlClean( &url );
-
     TAB_INIT( p_sys->i_media, p_sys->media );
     p_sys->i_media_id = 0;
 
@@ -296,6 +295,7 @@ static int Open( vlc_object_t *p_this )
         goto error;
     }
 
+    vlc_UrlClean( &url );
     return VLC_SUCCESS;
 
 error:
@@ -370,16 +370,15 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
 
     if( asprintf( &p_media->psz_rtsp_path, "%s%s",
                   p_sys->psz_path, psz_name ) <0 )
-        return NULL;
+        goto error;
+
     p_media->p_rtsp_url =
         httpd_UrlNew( p_sys->p_rtsp_host, p_media->psz_rtsp_path, NULL, NULL );
 
     if( !p_media->p_rtsp_url )
     {
         msg_Err( p_vod, "cannot create RTSP url (%s)", p_media->psz_rtsp_path);
-        free( p_media->psz_rtsp_path );
-        free( p_media );
-        return NULL;
+        goto error;
     }
 
     msg_Dbg( p_vod, "created RTSP url: %s", p_media->psz_rtsp_path );
@@ -387,21 +386,12 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
     if( asprintf( &p_media->psz_rtsp_control_v4,
                   "rtsp://%%s:%%d%s/trackID=%%d",
                   p_media->psz_rtsp_path ) < 0 )
-    {
-        httpd_UrlDelete( p_media->p_rtsp_url );
-        free( p_media->psz_rtsp_path );
-        free( p_media );
-        return NULL;
-    }
+        goto error;
+
     if( asprintf( &p_media->psz_rtsp_control_v6,
                   "rtsp://[%%s]:%%d%s/trackID=%%d",
                   p_media->psz_rtsp_path ) < 0 )
-    {
-        httpd_UrlDelete( p_media->p_rtsp_url );
-        free( p_media->psz_rtsp_path );
-        free( p_media );
-        return NULL;
-    }
+        goto error;
 
     httpd_UrlCatch( p_media->p_rtsp_url, HTTPD_MSG_SETUP,
                     RtspCallback, (void*)p_media );
@@ -432,6 +422,17 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
 
     CommandPush( p_vod, RTSP_CMD_TYPE_ADD, p_media, NULL, 0, 0.0, NULL );
     return p_media;
+
+error:
+    if( p_media )
+    {
+        free( p_media->psz_rtsp_control_v4 );
+        if( p_media->p_rtsp_url )
+            httpd_UrlDelete( p_media->p_rtsp_url );
+        free( p_media->psz_rtsp_path );
+        free( p_media );
+    }
+    return NULL;
 }
 
 static void MediaAskDel ( vod_t *p_vod, vod_media_t *p_media )