Changeset 48031dcee045d4d3855154f0ec946f1672c728d5
- Timestamp:
- 16/08/06 23:36:26
(2 years ago)
- Author:
- Dennis van Amerongen <trax@videolan.org>
- git-committer:
- Dennis van Amerongen <trax@videolan.org> 1155764186 +0000
- git-parent:
[b93020a1d8f9904022bf97c829890bfda928b6df]
- git-author:
- Dennis van Amerongen <trax@videolan.org> 1155764186 +0000
- Message:
* modules/access_output/shout.c: changed 'no bitrate information' warning to be used for both icecast and shoutcast.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r73a3acb |
r48031dc |
|
| 96 | 96 | #define QUALITY_LONGTEXT N_("Ogg Vorbis Quality information of the transcoded stream. " ) |
|---|
| 97 | 97 | |
|---|
| 98 | | #define PUBLIC_TEXT N_("Stream Public") |
|---|
| | 98 | #define PUBLIC_TEXT N_("Stream public") |
|---|
| 99 | 99 | #define PUBLIC_LONGTEXT N_("Make the server publicly available on the 'Yellow Pages' " \ |
|---|
| 100 | | "of icecast/shoutcast (directory listing of broadcast " \ |
|---|
| 101 | | "streams). Requires the bitrate information to be " \ |
|---|
| 102 | | "specified for shoutcast. Requires Ogg streaming " \ |
|---|
| 103 | | "for icecast." ) |
|---|
| | 100 | "(directory listing of streams) on the icecast/shoutcast " \ |
|---|
| | 101 | "website. Requires the bitrate information specified for " \ |
|---|
| | 102 | "shoutcast. Requires Ogg streaming for icecast." ) |
|---|
| 104 | 103 | |
|---|
| 105 | 104 | vlc_module_begin(); |
|---|
| … | … | |
| 121 | 120 | add_string( SOUT_CFG_PREFIX "url", "http://www.videolan.org/vlc", NULL, |
|---|
| 122 | 121 | URL_TEXT, URL_LONGTEXT, VLC_FALSE ); |
|---|
| 123 | | add_string( SOUT_CFG_PREFIX "bitrate", "0", NULL, |
|---|
| | 122 | add_string( SOUT_CFG_PREFIX "bitrate", "", NULL, |
|---|
| 124 | 123 | BITRATE_TEXT, BITRATE_LONGTEXT, VLC_FALSE ); |
|---|
| 125 | 124 | add_string( SOUT_CFG_PREFIX "samplerate", "", NULL, |
|---|
| … | … | |
| 178 | 177 | char *psz_genre = NULL; |
|---|
| 179 | 178 | char *psz_url = NULL; |
|---|
| 180 | | char *psz_bitrate = NULL; |
|---|
| 181 | 179 | |
|---|
| 182 | 180 | sout_CfgParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg ); |
|---|
| … | … | |
| 240 | 238 | free( val.psz_string ); |
|---|
| 241 | 239 | |
|---|
| 242 | | var_Get( p_access, SOUT_CFG_PREFIX "bitrate", &val ); |
|---|
| 243 | | if( *val.psz_string ) |
|---|
| 244 | | psz_bitrate = val.psz_string; |
|---|
| 245 | | else |
|---|
| 246 | | free( val.psz_string ); |
|---|
| 247 | | |
|---|
| 248 | 240 | p_shout = p_sys->p_shout = shout_new(); |
|---|
| 249 | 241 | if( !p_shout |
|---|
| … | … | |
| 259 | 251 | || shout_set_genre( p_shout, psz_genre ) != SHOUTERR_SUCCESS |
|---|
| 260 | 252 | || shout_set_url( p_shout, psz_url ) != SHOUTERR_SUCCESS |
|---|
| 261 | | || shout_set_audio_info( p_shout, SHOUT_AI_BITRATE, psz_bitrate ) != SHOUTERR_SUCCESS |
|---|
| 262 | 253 | // || shout_set_nonblocking( p_shout, 1 ) != SHOUTERR_SUCCESS |
|---|
| 263 | 254 | ) |
|---|
| … | … | |
| 274 | 265 | if( psz_genre ) free( psz_genre ); |
|---|
| 275 | 266 | if( psz_url ) free( psz_url ); |
|---|
| 276 | | if( psz_bitrate ) free( psz_bitrate ); |
|---|
| 277 | 267 | |
|---|
| 278 | 268 | var_Get( p_access, SOUT_CFG_PREFIX "mp3", &val ); |
|---|
| … | … | |
| 289 | 279 | return VLC_EGENERIC; |
|---|
| 290 | 280 | } |
|---|
| | 281 | |
|---|
| | 282 | |
|---|
| | 283 | /* Don't force bitrate to 0 but only use when specified. This will otherwise |
|---|
| | 284 | show an empty field on icecast directory listing instead of NA */ |
|---|
| | 285 | var_Get( p_access, SOUT_CFG_PREFIX "bitrate", &val ); |
|---|
| | 286 | if( *val.psz_string ) |
|---|
| | 287 | { |
|---|
| | 288 | i_ret = shout_set_audio_info( p_shout, SHOUT_AI_BITRATE, val.psz_string ); |
|---|
| | 289 | } |
|---|
| | 290 | else |
|---|
| | 291 | { |
|---|
| | 292 | /* Bitrate information is used for icecast/shoutcast servers directory |
|---|
| | 293 | listings (sorting, stream info etc.) */ |
|---|
| | 294 | msg_Warn( p_access, "no bitrate information specified (required for listing " \ |
|---|
| | 295 | "the server as public on the shoutcast website)" ); |
|---|
| | 296 | free( val.psz_string ); |
|---|
| | 297 | } |
|---|
| | 298 | |
|---|
| | 299 | if( i_ret != SHOUTERR_SUCCESS ) |
|---|
| | 300 | { |
|---|
| | 301 | msg_Err( p_access, "failed to set the information about the bitrate" ); |
|---|
| | 302 | free( p_access->p_sys ); |
|---|
| | 303 | free( psz_accessname ); |
|---|
| | 304 | return VLC_EGENERIC; |
|---|
| | 305 | } |
|---|
| | 306 | |
|---|
| | 307 | /* Information about samplerate, channels and quality will not be propagated |
|---|
| | 308 | through the YP protocol for icecast to the public directory listing when |
|---|
| | 309 | the icecast server is operating in shoutcast compatibility mode */ |
|---|
| 291 | 310 | |
|---|
| 292 | 311 | var_Get( p_access, SOUT_CFG_PREFIX "samplerate", &val ); |
|---|
| … | … | |
| 380 | 399 | free( psz_accessname ); |
|---|
| 381 | 400 | return VLC_EGENERIC; |
|---|
| 382 | | } |
|---|
| 383 | | |
|---|
| 384 | | /* Server status public requires the shout bitrate to be specified */ |
|---|
| 385 | | if( shout_get_audio_info ( p_shout, SHOUT_AI_BITRATE ) == "0" ) |
|---|
| 386 | | { |
|---|
| 387 | | if ( shout_get_public ( p_shout )) |
|---|
| 388 | | { |
|---|
| 389 | | msg_Warn( p_access, "server status public for shoutcast not supported: " \ |
|---|
| 390 | | "no bitrate specified" ); |
|---|
| 391 | | free( p_access->p_sys ); |
|---|
| 392 | | free( psz_accessname ); |
|---|
| 393 | | return VLC_EGENERIC; |
|---|
| 394 | | } |
|---|
| 395 | 401 | } |
|---|
| 396 | 402 | |
|---|