Show
Ignore:
Timestamp:
01/09/08 17:45:49 (3 months ago)
Author:
Rafaël Carré <rcarre@m2x.nl>
git-committer:
Rafaël Carré <rcarre@m2x.nl> 1220283949 +0200
git-parent:

[d369502a63fa8ccfce99a9e71ed0c1b94a1aad09]

git-author:
Rafaël Carré <rcarre@m2x.nl> 1220283949 +0200
Message:

live555: use floats for i_npt as well, remove useless checks

Fix Control() which was hit by the bug we wanted to fix...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/live555.cpp

    rd369502 ra567bae  
    155155    char            waiting; 
    156156    int64_t         i_pts; 
    157     int64_t         i_npt; 
     157    float           i_npt; 
    158158 
    159159} live_track_t; 
     
    190190    /* */ 
    191191    int64_t          i_pcr; /* The clock */ 
    192     int64_t          i_npt; 
     192    float            i_npt; 
    193193    float            i_npt_length; 
    194194    float            i_npt_start; 
     
    272272    p_sys->track   = NULL; 
    273273    p_sys->i_pcr = 0; 
    274     p_sys->i_npt = 0
    275     p_sys->i_npt_start = 0
    276     p_sys->i_npt_length = 0
     274    p_sys->i_npt = 0.
     275    p_sys->i_npt_start = 0.
     276    p_sys->i_npt_length = 0.
    277277    p_sys->p_out_asf = NULL; 
    278278    p_sys->b_no_data = true; 
     
    765765            tk->b_rtcp_sync = false; 
    766766            tk->i_pts       = 0; 
    767             tk->i_npt       = 0
     767            tk->i_npt       = 0.
    768768            tk->i_buffer    = 65536; 
    769769            tk->p_buffer    = (uint8_t *)malloc( 65536 ); 
     
    10061006    /* Retrieve the starttime if possible */ 
    10071007    p_sys->i_npt_start = p_sys->ms->playStartTime(); 
    1008     if( p_sys->i_npt_start < 0 ) 
    1009         p_sys->i_npt_start = -1; 
    10101008 
    10111009    /* Retrieve the duration if possible */ 
    10121010    p_sys->i_npt_length = p_sys->ms->playEndTime(); 
    1013     if( p_sys->i_npt_length < 0 ) 
    1014         p_sys->i_npt_length = -1; 
    10151011 
    10161012    msg_Dbg( p_demux, "setup start: %f stop:%f", p_sys->i_npt_start, p_sys->i_npt_length ); 
     
    10621058    /* Retrieve the starttime if possible */ 
    10631059    p_sys->i_npt_start = p_sys->ms->playStartTime(); 
    1064     if( p_sys->i_npt_start < 0 ) 
    1065         p_sys->i_npt_start = -1; 
    1066  
    10671060    p_sys->i_npt_length = p_sys->ms->playEndTime(); 
    1068     if( p_sys->i_npt_length < 0 ) 
    1069         p_sys->i_npt_length = -1; 
    10701061 
    10711062    msg_Dbg( p_demux, "play start: %f stop:%f", p_sys->i_npt_start, p_sys->i_npt_length ); 
     
    11531144            /* reset PCR */ 
    11541145            tk->i_pts = 0; 
    1155             tk->i_npt = 0
     1146            tk->i_npt = 0.
    11561147            p_sys->i_pcr = 0; 
    1157             p_sys->i_npt = 0
     1148            p_sys->i_npt = 0.
    11581149            i_pcr = 0; 
    11591150        } 
     
    12131204            if( p_sys->i_npt > 0 ) 
    12141205            { 
    1215                 *pi64 = p_sys->i_npt
     1206                *pi64 = (int64_t)(p_sys->i_npt * 1000000.)
    12161207                return VLC_SUCCESS; 
    12171208            } 
     
    12221213            if( p_sys->i_npt_length > 0 ) 
    12231214            { 
    1224                 *pi64 = p_sys->i_npt_length
     1215                *pi64 = p_sys->i_npt_length * 1000000.0
    12251216                return VLC_SUCCESS; 
    12261217            } 
     
    12431234                float time; 
    12441235 
    1245                 if( i_query == DEMUX_SET_TIME && p_sys->i_npt
     1236                if( i_query == DEMUX_SET_TIME && p_sys->i_npt > 0
    12461237                { 
    12471238                    i64 = (int64_t)va_arg( args, int64_t ); 
     
    12531244                { 
    12541245                    f = (double)va_arg( args, double ); 
    1255                     time = f * (double)p_sys->i_npt_length / (double)1000000.0;   /* in second */ 
     1246                    time = f * (double)p_sys->i_npt_length;   /* in second */ 
    12561247                } 
    12571248 
     
    12731264 
    12741265                /* Retrieve the starttime if possible */ 
    1275                 p_sys->i_npt_start = p_sys->ms->playStartTime(); 
    1276                 if( p_sys->i_npt_start < 0 ) 
    1277                     p_sys->i_npt_start = -1; 
    1278                 else p_sys->i_npt = p_sys->i_npt_start; 
     1266                p_sys->i_npt = p_sys->i_npt_start = p_sys->ms->playStartTime(); 
    12791267 
    12801268                /* Retrieve the duration if possible */ 
    12811269                p_sys->i_npt_length = p_sys->ms->playEndTime(); 
    1282                 if( p_sys->i_npt_length < 0 ) 
    1283                     p_sys->i_npt_length = -1; 
    12841270 
    12851271                msg_Dbg( p_demux, "seek start: %f stop:%f", p_sys->i_npt_start, p_sys->i_npt_length ); 
     
    12921278        case DEMUX_CAN_SEEK: 
    12931279            pb = (bool*)va_arg( args, bool * ); 
    1294             if( p_sys->rtsp && p_sys->i_npt_length
     1280            if( p_sys->rtsp && p_sys->i_npt_length > 0
    12951281                /* Not always true, but will be handled in SET_PAUSE_STATE */ 
    12961282                *pb = true; 
     
    13521338            p_sys->i_npt_start = 0; 
    13531339            p_sys->i_pcr = 0; 
    1354             p_sys->i_npt = 0
     1340            p_sys->i_npt = 0.
    13551341            es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); 
    13561342 
     
    14001386 
    14011387            /* Retrieve the starttime if possible */ 
    1402             p_sys->i_npt_start = p_sys->ms->playStartTime(); 
    1403             if( p_sys->i_npt_start < 0 ) 
    1404                 p_sys->i_npt_start = -1; 
    1405             else p_sys->i_npt = p_sys->i_npt_start; 
     1388            p_sys->i_npt = p_sys->i_npt_start = p_sys->ms->playStartTime(); 
    14061389 
    14071390            /* Retrieve the duration if possible */ 
    14081391            p_sys->i_npt_length = p_sys->ms->playEndTime(); 
    1409             if( p_sys->i_npt_length < 0 ) 
    1410                 p_sys->i_npt_length = -1; 
    14111392 
    14121393            msg_Dbg( p_demux, "pause start: %f stop:%f", p_sys->i_npt_start, p_sys->i_npt_length ); 
     
    15141495 
    15151496    /* Retrieve NPT for this pts */ 
    1516     tk->i_npt = (int64_t) INT64_C(1000000) * tk->sub->getNormalPlayTime(pts); 
     1497    tk->i_npt = tk->sub->getNormalPlayTime(pts); 
    15171498 
    15181499    if( tk->b_quicktime && tk->p_es == NULL )