]> git.sesse.net Git - vlc/blobdiff - modules/misc/rtsp.c
l10n string fixes
[vlc] / modules / misc / rtsp.c
index a97551dd4ee9f1d65c33c983976fa242708a3239..ff41506314f052e3b05bc4eed7cdd85a85346a4a 100644 (file)
@@ -365,10 +365,7 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
     int i;
 
     if( !p_media )
-    {
-        msg_Err( p_vod, "not enough memory" );
         return NULL;
-    }
 
     memset( p_media, 0, sizeof(vod_media_t) );
     p_media->id = p_sys->i_media_id++;
@@ -495,7 +492,10 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
     /* TODO: update SDP, etc... */
     if( asprintf( &psz_urlc, "%s/trackID=%d",
               p_media->psz_rtsp_path, p_media->i_es ) < 0 )
+    {
+        free( p_es );
         return VLC_ENOMEM;
+    }
     msg_Dbg( p_vod, "  - ES %4.4s (%s)", (char *)&p_fmt->i_codec, psz_urlc );
 
     switch( p_fmt->i_codec )
@@ -525,6 +525,7 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
                     p_fmt->audio.i_channels );
             break;
         case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
+        case VLC_FOURCC( 'm', 'p', '3', ' ' ):
             p_es->i_payload_type = 14;
             p_es->psz_rtpmap = strdup( "MPA/90000" );
             break;
@@ -534,7 +535,7 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
             break;
         case VLC_FOURCC( 'a', '5', '2', ' ' ):
             p_es->i_payload_type = p_media->i_payload_type++;
-            p_es->psz_rtpmap = strdup( "ac3/90000" );
+            asprintf( &p_es->psz_rtpmap, "ac3/%d", p_fmt->audio.i_rate );
             break;
         case VLC_FOURCC( 'H', '2', '6', '3' ):
             p_es->i_payload_type = p_media->i_payload_type++;
@@ -585,11 +586,19 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
                 }
                 /* */
                 if( p_64_sps && p_64_pps )
+                {
                     if( asprintf( &p_es->psz_fmtp,
                                   "packetization-mode=1;profile-level-id=%s;"
                                   "sprop-parameter-sets=%s,%s;", hexa, p_64_sps,
                                   p_64_pps ) < 0 )
+                    {
+                        free( p_64_sps );
+                        free( p_64_pps );
+                        free( psz_urlc );
+                        free( p_es );
                         return VLC_ENOMEM;
+                    }
+                }
                 free( p_64_sps );
                 free( p_64_pps );
             }
@@ -651,6 +660,7 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
         default:
             msg_Err( p_vod, "cannot add this stream (unsupported "
                     "codec: %4.4s)", (char*)&p_fmt->i_codec );
+            free( psz_urlc );
             free( p_es );
             return VLC_EGENERIC;
     }
@@ -788,7 +798,7 @@ static void CommandThread( vlc_object_t *p_this )
     vod_t *p_vod = (vod_t*)p_this;
     vod_sys_t *p_sys = p_vod->p_sys;
 
-    while( !p_vod->b_die )
+    while( vlc_object_alive (p_vod) )
     {
         block_t *p_block_cmd = block_FifoGet( p_sys->p_fifo_cmd );
         rtsp_cmd_t cmd;
@@ -1019,19 +1029,19 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
                     if( strstr( psz_transport, "MP2T/H2221/UDP" ) )
                     {
                         httpd_MsgAdd( answer, "Transport",
-                                      "MP2T/H2221/UDP;client_port=%d-%d",
+                                      "MP2T/H2221/UDP;unicast;client_port=%d-%d",
                                       i_port, i_port + 1 );
                     }
                     else if( strstr( psz_transport, "RAW/RAW/UDP" ) )
                     {
                         httpd_MsgAdd( answer, "Transport",
-                                      "RAW/RAW/UDP;client_port=%d-%d",
+                                      "RAW/RAW/UDP;unicast;client_port=%d-%d",
                                       i_port, i_port + 1 );
                     }
                 }
                 else
                     httpd_MsgAdd( answer, "Transport",
-                                  "RTP/AVP/UDP;client_port=%d-%d",
+                                  "RTP/AVP/UDP;unicast;client_port=%d-%d",
                                   i_port, i_port + 1 );
             }
             else /* TODO  strstr( psz_transport, "interleaved" ) ) */