Changeset e677a71b037e0b3ddb1735273afafa4493e7fb6b

Show
Ignore:
Timestamp:
10/02/06 18:24:25 (3 years ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1139592265 +0000
git-parent:

[15f7074e9da205cefd69d30f93a2d4e736ea95b0]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1139592265 +0000
Message:

Use correct Transport answer

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/misc/rtsp.c

    rd5584a6 re677a71  
    133133    media_es_t **es; 
    134134    char       *psz_mux; 
    135     int        b_raw; 
     135    vlc_bool_t  b_raw; 
    136136 
    137137    /* RTSP client */ 
     
    274274    p_media->psz_mux = 0; 
    275275    p_media->rtsp = 0; 
     276    p_media->b_raw = VLC_FALSE; 
    276277 
    277278    asprintf( &p_media->psz_rtsp_path, "%s%s", p_sys->psz_path, psz_name ); 
     
    632633    if( answer == NULL || query == NULL ) return VLC_SUCCESS; 
    633634 
    634     msg_Info( p_vod, "RtspCallback query: type=%d", query->i_type ); 
     635    msg_Dbg( p_vod, "RtspCallback query: type=%d", query->i_type ); 
    635636 
    636637    answer->i_proto   = HTTPD_PROTO_RTSP; 
    637638    answer->i_version = query->i_version; 
    638639    answer->i_type    = HTTPD_MSG_ANSWER; 
     640    answer->i_body    = 0; 
     641    answer->p_body      = NULL; 
    639642 
    640643    switch( query->i_type ) 
     
    657660                    strstr( psz_transport, "RAW/RAW/UDP" ) ) 
    658661                { 
    659                     p_media->b_raw = 1; 
    660                 } 
     662                    p_media->b_raw = VLC_TRUE; 
     663                } 
     664 
    661665                if( httpd_ClientIP( cl, ip ) == NULL ) 
    662666                { 
     
    669673 
    670674                msg_Dbg( p_vod, "HTTPD_MSG_SETUP: unicast ip=%s port=%d", 
    671                         ip, i_port ); 
     675                        ip, i_port ); 
    672676 
    673677                psz_session = httpd_MsgGet( query, "Session" ); 
     
    696700                answer->p_body = NULL; 
    697701 
    698                 httpd_MsgAdd( answer, "Transport", "RTP/AVP/UDP;client_port=%d-%d", 
    699                             i_port, i_port + 1 ); 
     702                if( p_media->b_raw ) 
     703                { 
     704                    if( strstr( psz_transport, "MP2T/H2221/UDP" ) ) 
     705                    { 
     706                        httpd_MsgAdd( answer, "Transport", "MP2T/H2221/UDP;client_port=%d-%d", 
     707                                      i_port, i_port + 1 ); 
     708                    } 
     709                    else if( strstr( psz_transport, "RAW/RAW/UDP" ) ) 
     710                    { 
     711                        httpd_MsgAdd( answer, "Transport", "RAW/RAW/UDP;client_port=%d-%d", 
     712                                      i_port, i_port + 1 ); 
     713                    } 
     714                } 
     715                else 
     716                    httpd_MsgAdd( answer, "Transport", "RTP/AVP/UDP;client_port=%d-%d", 
     717                                  i_port, i_port + 1 ); 
    700718            } 
    701719            else /* TODO  strstr( psz_transport, "interleaved" ) ) */ 
     
    706724                answer->p_body = NULL; 
    707725            } 
     726 
    708727            if( !psz_playnow ) 
    709728                break; 
     
    716735 
    717736            /* for now only multicast so easy */ 
    718             answer->i_status = 200; 
    719             answer->psz_status = strdup( "OK" ); 
    720             answer->i_body = 0; 
    721             answer->p_body = NULL; 
     737            if( !psz_playnow ) 
     738            { 
     739                answer->i_status = 200; 
     740                answer->psz_status = strdup( "OK" ); 
     741                answer->i_body = 0; 
     742                answer->p_body = NULL; 
     743            } 
    722744 
    723745            if( !psz_session ) 
     
    865887    if( answer == NULL || query == NULL ) return VLC_SUCCESS; 
    866888 
    867     msg_Info( p_vod, "RtspCallback query: type=%d", query->i_type ); 
     889    msg_Dbg( p_vod, "RtspCallback query: type=%d", query->i_type ); 
    868890 
    869891    answer->i_proto   = HTTPD_PROTO_RTSP; 
    870892    answer->i_version = query->i_version; 
    871893    answer->i_type    = HTTPD_MSG_ANSWER; 
     894    answer->i_body    = 0; 
     895    answer->p_body      = NULL; 
    872896 
    873897    switch( query->i_type ) 
     
    931955                answer->p_body = NULL; 
    932956 
    933                 httpd_MsgAdd( answer, "Transport", "RTP/AVP/UDP;client_port=%d-%d", 
    934                             i_port, i_port + 1 ); 
     957                if( p_media->b_raw ) 
     958                { 
     959                    if( strstr( psz_transport, "MP2T/H2221/UDP" ) ) 
     960                    { 
     961                        httpd_MsgAdd( answer, "Transport", "MP2T/H2221/UDP;client_port=%d-%d", 
     962                                      i_port, i_port + 1 ); 
     963                    } 
     964                    else if( strstr( psz_transport, "RAW/RAW/UDP" ) ) 
     965                    { 
     966                        httpd_MsgAdd( answer, "Transport", "RAW/RAW/UDP;client_port=%d-%d", 
     967                                      i_port, i_port + 1 ); 
     968                    } 
     969                } 
     970                else 
     971                { 
     972                    httpd_MsgAdd( answer, "Transport", "RTP/AVP/UDP;client_port=%d-%d", 
     973                                  i_port, i_port + 1 ); 
     974                } 
    935975            } 
    936976            else /* TODO  strstr( psz_transport, "interleaved" ) ) */ 
     
    941981                answer->p_body = NULL; 
    942982            } 
     983 
    943984            if( !psz_playnow ) 
    944985                break; 
     
    9691010            } 
    9701011 
    971             answer->i_status = 200; 
    972             answer->psz_status = strdup( "OK" ); 
    973             answer->i_body = 0; 
    974             answer->p_body = NULL; 
     1012            if( !psz_playnow ) 
     1013            { 
     1014                answer->i_status = 200; 
     1015                answer->psz_status = strdup( "OK" ); 
     1016                answer->i_body = 0; 
     1017                answer->p_body = NULL; 
     1018            } 
    9751019            break; 
    9761020