]> git.sesse.net Git - vlc/blobdiff - modules/misc/rtsp.c
Remove "saved-volume" and "volume-change". Use "volume".
[vlc] / modules / misc / rtsp.c
index 77123af3b4f27f4e345d1800584a9999a5ae6aec..98999db2728a536da6085a79ac37b037cb10c751 100644 (file)
@@ -113,6 +113,7 @@ typedef struct
     char *psz_session;
 
     bool b_playing; /* is it in "play" state */
+    int i_port_raw;
 
     int i_es;
     rtsp_client_es_t **es;
@@ -300,8 +301,7 @@ static int Open( vlc_object_t *p_this )
     p_vod->pf_media_del = MediaAskDel;
 
     p_sys->p_fifo_cmd = block_FifoNew();
-    if( vlc_thread_create( p_vod, "rtsp vod thread", CommandThread,
-                           VLC_THREAD_PRIORITY_LOW ) )
+    if( vlc_thread_create( p_vod, CommandThread, VLC_THREAD_PRIORITY_LOW ) )
     {
         msg_Err( p_vod, "cannot spawn rtsp vod thread" );
         block_FifoRelease( p_sys->p_fifo_cmd );
@@ -826,12 +826,14 @@ static void* CommandThread( vlc_object_t *p_this )
         switch( cmd.i_type )
         {
         case RTSP_CMD_TYPE_PLAY:
+            cmd.i_arg = -1;
             vod_MediaControl( p_vod, p_media, cmd.psz_session,
-                              VOD_MEDIA_PLAY, cmd.psz_arg );
+                              VOD_MEDIA_PLAY, cmd.psz_arg, &cmd.i_arg );
             break;
         case RTSP_CMD_TYPE_PAUSE:
+            cmd.i_arg = -1;
             vod_MediaControl( p_vod, p_media, cmd.psz_session,
-                              VOD_MEDIA_PAUSE );
+                              VOD_MEDIA_PAUSE, &cmd.i_arg );
             break;
 
         case RTSP_CMD_TYPE_STOP:
@@ -950,7 +952,6 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
     const char *psz_session = NULL;
     const char *psz_cseq = NULL;
     rtsp_client_t *p_rtsp;
-    int i_port = 0;
     int i_cseq = 0;
 
     if( answer == NULL || query == NULL ) return VLC_SUCCESS;
@@ -981,8 +982,8 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
             {
                 rtsp_client_t *p_rtsp = NULL;
                 char ip[NI_MAXNUMERICHOST];
-                i_port = atoi( strstr( psz_transport, "client_port=" ) +
-                                strlen("client_port=") );
+                int i_port = atoi( strstr( psz_transport, "client_port=" ) +
+                                   strlen("client_port=") );
 
                 if( strstr( psz_transport, "MP2T/H2221/UDP" ) ||
                     strstr( psz_transport, "RAW/RAW/UDP" ) )
@@ -1046,6 +1047,8 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
 
                 if( p_media->b_raw )
                 {
+                    p_rtsp->i_port_raw = i_port;
+
                     if( strstr( psz_transport, "MP2T/H2221/UDP" ) )
                     {
                         httpd_MsgAdd( answer, "Transport",
@@ -1164,7 +1167,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
                 {
                     if( asprintf( &psz_output,
                               "std{access=udp,dst=%s:%i,mux=%s}",
-                              ip, i_port, p_media->psz_mux ) < 0 )
+                              ip, p_rtsp->i_port_raw, p_media->psz_mux ) < 0 )
                         return VLC_ENOMEM;
                 }
                 else
@@ -1540,7 +1543,7 @@ static char *SDPGenerate( const vod_media_t *p_media, httpd_client_t *cl )
     if( p_media->i_length > 0 )
     {
         lldiv_t d = lldiv( p_media->i_length / 1000, 1000 );
-        sdp_AddAttribute( &psz_sdp, "range"," npt=0-%lld.%03u", d.quot,
+        sdp_AddAttribute( &psz_sdp, "range","npt=0-%lld.%03u", d.quot,
                           (unsigned)d.rem );
     }