[vlc-devel] [PATCH] RTP PAUSE support..

Brian braymond at attemptatsanity.com
Tue Mar 27 04:03:53 CEST 2007


I noticed PAUSE wasn't implemented for RTSP sessions using the RTP  
module so I used the TEARDOWN code minus the client deletion and it  
seems to work correctly.

Index: modules/stream_out/rtp.c
===================================================================
--- modules/stream_out/rtp.c    (revision 19482)
+++ modules/stream_out/rtp.c    (working copy)
@@ -1698,8 +1698,42 @@
              break;
          }
          case HTTPD_MSG_PAUSE:
-            /* FIXME */
-            return VLC_EGENERIC;
+        {
+            rtsp_client_t *rtsp;
+
+            answer->i_status = 200;
+            answer->psz_status = strdup( "OK" );
+            answer->i_body = 0;
+            answer->p_body = NULL;
+
+            psz_session = httpd_MsgGet( query, "Session" );
+            rtsp = RtspClientGet( p_stream, psz_session );
+            if( rtsp && rtsp->b_playing )
+            {
+                int i_id;
+                /* FIXME */
+                rtsp->b_playing = VLC_FALSE;
+                vlc_mutex_lock( &p_sys->lock_es );
+                for( i_id = 0; i_id < rtsp->i_id; i_id++ )
+                {
+                    sout_stream_id_t *id = rtsp->id[i_id];
+                    int i;
+
+                    for( i = 0; i < p_sys->i_es; i++ )
+                    {
+                        if( id == p_sys->es[i] )
+                            break;
+                    }
+                    if( i >= p_sys->i_es ) continue;
+
+                    vlc_mutex_lock( &id->lock_rtsp );
+                    TAB_REMOVE( id->i_rtsp_access, id->rtsp_access,  
rtsp->access[i_id] );
+                    vlc_mutex_unlock( &id->lock_rtsp );
+                }
+                vlc_mutex_unlock( &p_sys->lock_es );
+            }
+            break;
+        }
          case HTTPD_MSG_TEARDOWN:
          {
              rtsp_client_t *rtsp;

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list