[vlc-devel] Patch to "modules/access/live555.cpp" to fix the recently-discovered RTSP subtitle track problem

Ross Finlayson finlayson at live555.com
Mon Dec 16 06:22:05 CET 2013


Recently Gilles Chanteperdrix reported (on the wrong VLC mailing list :-) that attempting to enable a subtitle track in a RTSP stream would cause VLC (version 2.1) to halt the stream.

The problem was introduced (to the file "modules/access/live555.cpp") between versions 2.0.9 and 2.1.0.  The problem was that when the code (the "Demux()" function) discovered that the subtitle track was disabled, it sent a RTSP "TEARDOWN" for that track.  Later, when the user tried to enable the track, the code would then try to turn the stream back on by sending RTSP "SETUP" and "PLAY" commands.  However, most servers will not handle this, because they will have handled the previous "TEARDOWN" command by completely shutting down the subtitle stream; not just disabling it.

The following patch - to modules/access/live555.cpp - fixes this by disabling the track using a RTSP "PAUSE" command (rather than "TEARDOWN"), and reenabling the track using a RTSP "PLAY" command (rather than "SETUP"+"PLAY").

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


diff -b -B -c live555.cpp.old live555.cpp.new
*** live555.cpp.old	Sun Dec 15 02:00:49 2013
--- live555.cpp.new	Sun Dec 15 21:02:40 2013
***************
*** 1218,1240 ****
              if( !b && tk->b_selected )
              {
                  tk->b_selected = false;
!                 p_sys->rtsp->sendTeardownCommand( *tk->sub, NULL );
              }
              else if( b && !tk->b_selected)
              {
-                 bool b_rtsp_tcp = var_GetBool( p_demux, "rtsp-tcp" ) ||
-                                   var_GetBool( p_demux, "rtsp-http" );
-                 p_sys->rtsp->sendSetupCommand( *tk->sub, default_live555_callback, False,
-                                                toBool( b_rtsp_tcp ),
-                                                toBool( p_sys->b_force_mcast && !b_rtsp_tcp ) );
-                 if( !wait_Live555_response( p_demux ) )
-                 {
-                     msg_Err( p_demux, "SETUP of'%s/%s' failed %s",
-                              tk->sub->mediumName(), tk->sub->codecName(),
-                              p_sys->env->getResultMsg() );
-                 }
-                 else
-                 {
                      p_sys->rtsp->sendPlayCommand( *tk->sub, default_live555_callback, -1, -1, p_sys->ms->scale() );
                      if( !wait_Live555_response(p_demux) )
                      {
--- 1218,1227 ----
              if( !b && tk->b_selected )
              {
                  tk->b_selected = false;
!                 p_sys->rtsp->sendPauseCommand( *tk->sub, NULL );
              }
              else if( b && !tk->b_selected)
              {
                  p_sys->rtsp->sendPlayCommand( *tk->sub, default_live555_callback, -1, -1, p_sys->ms->scale() );
  		if( !wait_Live555_response(p_demux) )
  		{
***************
*** 1243,1249 ****
                      }
                      else
                          tk->b_selected = true;
-                 }
                  if( !tk->b_selected )
                      es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->p_es, false );
              }
--- 1230,1235 ----




More information about the vlc-devel mailing list