[vlc-devel] Re: Fix to make VoD work with HansunTech STBs

Sašo Kiselkov skiselkov at gmail.com
Fri Jan 12 12:19:50 CET 2007


Implemented your suggestion.

--
Saso

Damien Fouilleul wrote:
> just my 2 eurocents worths:
> 
> in a lot of protocols (not just RSTP) timeout=0 is interpreted as 'no
> timeout' by the client and can be useful to have as an option. Therefore
> i would suggest that use you use -1 rather than 0 to indicate that the
> timeout field should be removed from the session (which would usually
> mean that the client should use use a hardcoded default)
> 
> therefore i suggest that you rework the option as follow:
> 
> -1 (Default timeout), meaning leave session field blank
> 0  (no timeout)
> n  (timeout value of n)
> 
> Damien
> 
> Sašo Kiselkov wrote:
>> Thanks for the notes, that's a good idea.
>>
>> One more problem I've found (and already integrated into the patch) is
>> that when muxing is enabled, then VLC doesn't read the remote port info
>> properly - when it starts streaming it sends it all to port 0, since the
>> i_port variable in the PLAY request isn't set up properly. I've added
>> code into SETUP which intercepts the port supplied by the client and
>> stores it in the vod_sys_t structure.
>>
>> -- 
>> Saso
>>
>> Jean-Paul Saman wrote:
>>  
>>> Sašo Kiselkov wrote:
>>>    
>>>> Here's the exact patch.
>>>>
>>>> -- 
>>>> Saso
>>>>       
>>> Thanks for the patch. I have one more request ;-) could you make the
>>> timeout value configurable. By making the rtsp-session-timeout accept a
>>> value instead of being a boolean.
>>>
>>> 0 would mean disabled
>>> 1  and greater would set the timeout in seconds
>>>
>>> and let the helptext reflect this.
>>>
>>> Thanks,
>>> Jean-Paul Saman.
>>>    
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>> --- vlc-0.8.6-old/modules/misc/rtsp.c    2006-12-09 02:12:16.000000000
>>>> +0100
>>>> +++ vlc-0.8.6/modules/misc/rtsp.c    2007-01-12 00:31:22.000000000
>>>> +0100
>>>> @@ -58,4 +58,10 @@
>>>>      "that can connect to the RTSP VOD. 0 means no limit."  )
>>>>  
>>>> +#define SESSION_TIMEOUT_TEXT N_( "Add a timeout option to the RTSP
>>>> session " \
>>>> +    "ID string" )
>>>> +#define SESSION_TIMEOUT_LONGTEXT N_( "Adds a timeout option to RTSP
>>>> session " \
>>>> +    "ID string. Needed by some STBs and confuses some other STBs
>>>> (such as " \
>>>> +    "those made by HansunTech)." ) +
>>>>  vlc_module_begin();
>>>>      set_shortname( _("RTSP VoD" ) );
>>>> @@ -69,4 +75,6 @@
>>>>      add_integer( "rtsp-throttle-users", 0, NULL, THROTLE_TEXT,
>>>>                                             THROTLE_LONGTEXT,
>>>> VLC_TRUE );
>>>> +    add_bool( "rtsp-session-timeout", VLC_TRUE, NULL,
>>>> SESSION_TIMEOUT_TEXT,
>>>> +              SESSION_TIMEOUT_LONGTEXT, VLC_TRUE );
>>>>  vlc_module_end();
>>>>  
>>>> @@ -167,4 +175,6 @@
>>>>      int i_connections;
>>>>  
>>>> +    vlc_bool_t b_session_timeout;
>>>> +
>>>>      /* List of media */
>>>>      int i_media;
>>>> @@ -221,4 +231,6 @@
>>>>      p_sys->p_rtsp_host = 0;
>>>>  
>>>> +    p_sys->b_session_timeout = var_GetBool( p_this,
>>>> "rtsp-session-timeout" );
>>>> +
>>>>      var_Create( p_this, "rtsp-throttle-users", VLC_VAR_INTEGER |
>>>> VLC_VAR_DOINHERIT );
>>>>      p_sys->i_throttle_users = var_GetInteger( p_this,
>>>> "rtsp-throtle-users" );
>>>> @@ -932,6 +944,9 @@
>>>>      if( psz_session )
>>>>      {
>>>> -        httpd_MsgAdd( answer, "Session", "%s;timeout=5",
>>>> psz_session );
>>>> -    }
>>>> +         if( p_media->p_vod->p_sys->b_session_timeout )
>>>> +             httpd_MsgAdd( answer, "Session", "%s;timeout=5",
>>>> psz_session );
>>>> +         else
>>>> +              httpd_MsgAdd( answer, "Session", "%s", psz_session );
>>>> +    }       return VLC_SUCCESS;
>>>>       
>>>     
>>
>>  
>> ------------------------------------------------------------------------
>>
>> --- vlc-0.8.6-old/modules/misc/rtsp.c    2006-12-09 02:12:16.000000000
>> +0100
>> +++ vlc-0.8.6/modules/misc/rtsp.c    2007-01-12 10:47:29.000000000 +0100
>> @@ -58,4 +58,11 @@
>>      "that can connect to the RTSP VOD. 0 means no limit."  )
>>  
>> +#define SESSION_TIMEOUT_TEXT N_( "Sets the timeout option in the RTSP
>> " \
>> +    "session string" )
>> +#define SESSION_TIMEOUT_LONGTEXT N_( "Defines what timeout option to
>> add " \
>> +    "to the RTSP session ID string. Setting it to 0 removes the
>> timeout " \
>> +    "option entirely. This is needed by some IPTV STBs (such as those
>> made " \
>> +    "by HansunTech) which get confused by it. The default is 5." )
>> +
>>  vlc_module_begin();
>>      set_shortname( _("RTSP VoD" ) );
>> @@ -69,4 +76,6 @@
>>      add_integer( "rtsp-throttle-users", 0, NULL, THROTLE_TEXT,
>>                                             THROTLE_LONGTEXT, VLC_TRUE );
>> +    add_integer( "rtsp-session-timeout", 5, NULL, SESSION_TIMEOUT_TEXT,
>> +                 SESSION_TIMEOUT_LONGTEXT, VLC_TRUE );
>>  vlc_module_end();
>>  
>> @@ -93,4 +102,6 @@
>>      vlc_bool_t b_paused; /* is it in "pause" state */
>>  
>> +    int i_port; /* port used with muxed output */
>> +
>>      int i_es;
>>      rtsp_client_es_t **es;
>> @@ -167,4 +178,6 @@
>>      int i_connections;
>>  
>> +    int i_session_timeout;
>> +
>>      /* List of media */
>>      int i_media;
>> @@ -221,4 +234,6 @@
>>      p_sys->p_rtsp_host = 0;
>>  
>> +    p_sys->i_session_timeout = config_GetInt( p_this,
>> "rtsp-session-timeout" );
>> +
>>      var_Create( p_this, "rtsp-throttle-users", VLC_VAR_INTEGER |
>> VLC_VAR_DOINHERIT );
>>      p_sys->i_throttle_users = var_GetInteger( p_this,
>> "rtsp-throtle-users" );
>> @@ -735,4 +750,6 @@
>>                  }
>>  
>> +                p_rtsp->i_port = i_port;
>> +
>>                  answer->i_status = 200;
>>                  answer->psz_status = strdup( "OK" );
>> @@ -842,5 +859,5 @@
>>                  {
>>                      asprintf( &psz_output,
>> "std{access=udp,dst=%s:%i,mux=%s}",
>> -                              ip, i_port, p_media->psz_mux );
>> +                              ip, p_rtsp->i_port, p_media->psz_mux );
>>                  }
>>                  else
>> @@ -932,6 +949,10 @@
>>      if( psz_session )
>>      {
>> -        httpd_MsgAdd( answer, "Session", "%s;timeout=5", psz_session );
>> -    }
>> +         if( p_media->p_vod->p_sys->i_session_timeout )
>> +             httpd_MsgAdd( answer, "Session", "%s;timeout=%i",
>> psz_session,
>> +               p_media->p_vod->p_sys->i_session_timeout );
>> +         else
>> +              httpd_MsgAdd( answer, "Session", "%s", psz_session );
>> +    }  
>>      return VLC_SUCCESS;
>>   
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vlc-session-timeout-and-mux-port.patch
Type: text/x-patch
Size: 2526 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070112/c52791cb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070112/c52791cb/attachment.sig>


More information about the vlc-devel mailing list