Changeset 44dd0b86e9b68f4f00511e943afd37e589bd38a3
- Timestamp:
- 27/12/07 15:31:43
(1 year ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1198765903 +0000
- git-parent:
[fff37839759c1d6b7838838f923d49ee1bcb3bf1]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1198765903 +0000
- Message:
Fix segfault when Connect() returned failure and fix memleaks. Make sure live555 modules exits while in Connect() if vlc is asked to stop.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r64fcf93 |
r44dd0b8 |
|
| 476 | 476 | |
|---|
| 477 | 477 | createnew: |
|---|
| | 478 | if( p_demux->b_die || p_demux->b_error ) |
|---|
| | 479 | { |
|---|
| | 480 | free( psz_user ); |
|---|
| | 481 | free( psz_pwd ); |
|---|
| | 482 | free( psz_url ); |
|---|
| | 483 | return VLC_EGENERIC; |
|---|
| | 484 | } |
|---|
| | 485 | |
|---|
| 478 | 486 | if( var_CreateGetBool( p_demux, "rtsp-http" ) ) |
|---|
| 479 | 487 | i_http_port = var_CreateGetInteger( p_demux, "rtsp-http-port" ); |
|---|
| … | … | |
| 485 | 493 | msg_Err( p_demux, "RTSPClient::createNew failed (%s)", |
|---|
| 486 | 494 | p_sys->env->getResultMsg() ); |
|---|
| | 495 | free( psz_user ); |
|---|
| | 496 | free( psz_pwd ); |
|---|
| | 497 | free( psz_url ); |
|---|
| 487 | 498 | return VLC_EGENERIC; |
|---|
| 488 | 499 | } |
|---|
| … | … | |
| 511 | 522 | |
|---|
| 512 | 523 | p_sdp = p_sys->rtsp->describeURL( psz_url, &authenticator, |
|---|
| 513 | | var_CreateGetBool( p_demux, "rtsp-kasenna" ) ); |
|---|
| | 524 | var_GetBool( p_demux, "rtsp-kasenna" ) ); |
|---|
| 514 | 525 | if( p_sdp == NULL ) |
|---|
| 515 | 526 | { |
|---|
| … | … | |
| 518 | 529 | const char *psz_error = p_sys->env->getResultMsg(); |
|---|
| 519 | 530 | |
|---|
| 520 | | msg_Dbg( p_demux, "DESCRIBE failed with %d: %s", i_code, psz_error ); |
|---|
| 521 | | if( var_CreateGetBool( p_demux, "rtsp-http" ) ) |
|---|
| | 531 | if( var_GetBool( p_demux, "rtsp-http" ) ) |
|---|
| 522 | 532 | sscanf( psz_error, "%*s %*s HTTP GET %*s HTTP/%*u.%*u %3u %*s", |
|---|
| 523 | 533 | &i_code ); |
|---|
| 524 | 534 | else sscanf( psz_error, "%*sRTSP/%*s%3u", &i_code ); |
|---|
| | 535 | msg_Dbg( p_demux, "DESCRIBE failed with %d: %s", i_code, psz_error ); |
|---|
| 525 | 536 | |
|---|
| 526 | 537 | if( i_code == 401 ) |
|---|
| … | … | |
| 543 | 554 | } |
|---|
| 544 | 555 | } |
|---|
| 545 | | else if( !var_GetBool( p_demux, "rtsp-http" ) ) |
|---|
| | 556 | else if( (i_code != 0) && !var_GetBool( p_demux, "rtsp-http" ) ) |
|---|
| 546 | 557 | { |
|---|
| 547 | 558 | /* Perhaps a firewall is being annoying. Try HTTP tunneling mode */ |
|---|
| … | … | |
| 551 | 562 | var_Set( p_demux, "rtsp-http", val ); |
|---|
| 552 | 563 | if( p_sys->rtsp ) RTSPClient::close( p_sys->rtsp ); |
|---|
| | 564 | p_sys->rtsp = NULL; |
|---|
| 553 | 565 | goto createnew; |
|---|
| 554 | 566 | } |
|---|
| … | … | |
| 557 | 569 | msg_Dbg( p_demux, "connection timeout, retrying" ); |
|---|
| 558 | 570 | if( p_sys->rtsp ) RTSPClient::close( p_sys->rtsp ); |
|---|
| | 571 | p_sys->rtsp = NULL; |
|---|
| 559 | 572 | goto createnew; |
|---|
| 560 | 573 | } |
|---|
| 561 | 574 | i_ret = VLC_EGENERIC; |
|---|
| 562 | 575 | } |
|---|
| | 576 | |
|---|
| | 577 | /* malloc-ated copy */ |
|---|
| 563 | 578 | if( psz_url ) free( psz_url ); |
|---|
| 564 | | |
|---|
| 565 | | /* malloc-ated copy */ |
|---|
| 566 | 579 | if( psz_user ) free( psz_user ); |
|---|
| 567 | 580 | if( psz_pwd ) free( psz_pwd ); |
|---|