[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 30 10:27:30 CET 2013


On Dec 15, 2013, at 9:22 PM, Ross Finlayson <finlayson at live555.com> wrote:

> 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").

FYI, although Gilles' later patch (to lookup the SDP 'language' attribute) ended up being adopted, this (earlier) patch had not yet been adopted.  So I'm resending the patch (updated for the latest git version):

diff -b -B -c live555.cpp.old live555.cpp.new
*** live555.cpp.old	2013-12-30 00:49:01.000000000 -0800
--- live555.cpp.new	2013-12-30 00:59:03.000000000 -0800
***************
*** 1247,1269 ****
              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) )
                      {
--- 1247,1256 ----
              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) )
                {
***************
*** 1272,1278 ****
                      }
                      else
                          tk->b_selected = true;
-                 }
                  if( !tk->b_selected )
                      es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->p_es, false );
              }
--- 1259,1264 ----




More information about the vlc-devel mailing list