[vlc-devel] commit: vod: remove useless strdup()'s (Pierre Ynard )

git version control git at videolan.org
Wed Jan 20 19:35:44 CET 2010


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Wed Jan 20 19:35:06 2010 +0100| [5244f8cc7e7bee0edaeea00697887840a723ed56] | committer: Pierre Ynard 

vod: remove useless strdup()'s

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

 modules/misc/rtsp.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c
index 94c0ef7..d88522e 100644
--- a/modules/misc/rtsp.c
+++ b/modules/misc/rtsp.c
@@ -158,7 +158,7 @@ struct vod_media_t
     /* ES list */
     int        i_es;
     media_es_t **es;
-    char       *psz_mux;
+    const char *psz_mux;
     bool  b_raw;
 
     /* RTSP client */
@@ -492,7 +492,6 @@ static void MediaDel( vod_t *p_vod, vod_media_t *p_media )
 
     vlc_mutex_destroy( &p_media->lock );
 
-    free( p_media->psz_mux );
     free( p_media );
 }
 
@@ -503,7 +502,6 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
     if( !p_es )
         return VLC_ENOMEM;
 
-    free( p_media->psz_mux );
     p_media->psz_mux = NULL;
 
     /* TODO: update SDP, etc... */
@@ -657,12 +655,12 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
             }
             break;
         case VLC_FOURCC( 'm', 'p', '2', 't' ):
-            p_media->psz_mux = strdup("ts");
+            p_media->psz_mux = "ts";
             p_es->i_payload_type = 33;
             p_es->psz_ptname = "MP2T";
             break;
         case VLC_FOURCC( 'm', 'p', '2', 'p' ):
-            p_media->psz_mux = strdup("ps");
+            p_media->psz_mux = "ps";
             p_es->i_payload_type = p_media->i_payload_type++;
             p_es->psz_ptname = "MP2P";
             break;
@@ -994,9 +992,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
                 if( strstr( psz_transport, "MP2T/H2221/UDP" ) ||
                     strstr( psz_transport, "RAW/RAW/UDP" ) )
                 {
-                    free( p_media->psz_mux );
-                    p_media->psz_mux = NULL;
-                    p_media->psz_mux = strdup( p_vod->p_sys->psz_raw_mux );
+                    p_media->psz_mux = p_vod->p_sys->psz_raw_mux;
                     p_media->b_raw = true;
                 }
 




More information about the vlc-devel mailing list