- Timestamp:
- 01/09/08 17:45:49 (3 months ago)
- git-parent:
- Files:
-
- modules/demux/live555.cpp (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/demux/live555.cpp
rd369502 ra567bae 155 155 char waiting; 156 156 int64_t i_pts; 157 int64_ti_npt;157 float i_npt; 158 158 159 159 } live_track_t; … … 190 190 /* */ 191 191 int64_t i_pcr; /* The clock */ 192 int64_ti_npt;192 float i_npt; 193 193 float i_npt_length; 194 194 float i_npt_start; … … 272 272 p_sys->track = NULL; 273 273 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.; 277 277 p_sys->p_out_asf = NULL; 278 278 p_sys->b_no_data = true; … … 765 765 tk->b_rtcp_sync = false; 766 766 tk->i_pts = 0; 767 tk->i_npt = 0 ;767 tk->i_npt = 0.; 768 768 tk->i_buffer = 65536; 769 769 tk->p_buffer = (uint8_t *)malloc( 65536 ); … … 1006 1006 /* Retrieve the starttime if possible */ 1007 1007 p_sys->i_npt_start = p_sys->ms->playStartTime(); 1008 if( p_sys->i_npt_start < 0 )1009 p_sys->i_npt_start = -1;1010 1008 1011 1009 /* Retrieve the duration if possible */ 1012 1010 p_sys->i_npt_length = p_sys->ms->playEndTime(); 1013 if( p_sys->i_npt_length < 0 )1014 p_sys->i_npt_length = -1;1015 1011 1016 1012 msg_Dbg( p_demux, "setup start: %f stop:%f", p_sys->i_npt_start, p_sys->i_npt_length ); … … 1062 1058 /* Retrieve the starttime if possible */ 1063 1059 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 1067 1060 p_sys->i_npt_length = p_sys->ms->playEndTime(); 1068 if( p_sys->i_npt_length < 0 )1069 p_sys->i_npt_length = -1;1070 1061 1071 1062 msg_Dbg( p_demux, "play start: %f stop:%f", p_sys->i_npt_start, p_sys->i_npt_length ); … … 1153 1144 /* reset PCR */ 1154 1145 tk->i_pts = 0; 1155 tk->i_npt = 0 ;1146 tk->i_npt = 0.; 1156 1147 p_sys->i_pcr = 0; 1157 p_sys->i_npt = 0 ;1148 p_sys->i_npt = 0.; 1158 1149 i_pcr = 0; 1159 1150 } … … 1213 1204 if( p_sys->i_npt > 0 ) 1214 1205 { 1215 *pi64 = p_sys->i_npt;1206 *pi64 = (int64_t)(p_sys->i_npt * 1000000.); 1216 1207 return VLC_SUCCESS; 1217 1208 } … … 1222 1213 if( p_sys->i_npt_length > 0 ) 1223 1214 { 1224 *pi64 = p_sys->i_npt_length ;1215 *pi64 = p_sys->i_npt_length * 1000000.0; 1225 1216 return VLC_SUCCESS; 1226 1217 } … … 1243 1234 float time; 1244 1235 1245 if( i_query == DEMUX_SET_TIME && p_sys->i_npt )1236 if( i_query == DEMUX_SET_TIME && p_sys->i_npt > 0 ) 1246 1237 { 1247 1238 i64 = (int64_t)va_arg( args, int64_t ); … … 1253 1244 { 1254 1245 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 */ 1256 1247 } 1257 1248 … … 1273 1264 1274 1265 /* 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(); 1279 1267 1280 1268 /* Retrieve the duration if possible */ 1281 1269 p_sys->i_npt_length = p_sys->ms->playEndTime(); 1282 if( p_sys->i_npt_length < 0 )1283 p_sys->i_npt_length = -1;1284 1270 1285 1271 msg_Dbg( p_demux, "seek start: %f stop:%f", p_sys->i_npt_start, p_sys->i_npt_length ); … … 1292 1278 case DEMUX_CAN_SEEK: 1293 1279 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 ) 1295 1281 /* Not always true, but will be handled in SET_PAUSE_STATE */ 1296 1282 *pb = true; … … 1352 1338 p_sys->i_npt_start = 0; 1353 1339 p_sys->i_pcr = 0; 1354 p_sys->i_npt = 0 ;1340 p_sys->i_npt = 0.; 1355 1341 es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); 1356 1342 … … 1400 1386 1401 1387 /* 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(); 1406 1389 1407 1390 /* Retrieve the duration if possible */ 1408 1391 p_sys->i_npt_length = p_sys->ms->playEndTime(); 1409 if( p_sys->i_npt_length < 0 )1410 p_sys->i_npt_length = -1;1411 1392 1412 1393 msg_Dbg( p_demux, "pause start: %f stop:%f", p_sys->i_npt_start, p_sys->i_npt_length ); … … 1514 1495 1515 1496 /* 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); 1517 1498 1518 1499 if( tk->b_quicktime && tk->p_es == NULL )
