Changeset 410
- Timestamp:
- 02/20/07 15:06:00 (17 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/streaming-rework/src/libstreaming/MotuStreamProcessor.cpp
r407 r410 282 282 // appears to do rounding. 283 283 284 float ticks_per_frame = m_SyncSource->m_data_buffer->getRate(); 284 285 for (i=0; i<n_events; i++, quadlet += dbs) { 285 *quadlet = htonl( TICKS_TO_CYCLE_TIMER(ts) ); 286 unsigned int ts_frame = ts; 287 ts_frame += (unsigned int)((float)i * ticks_per_frame); 288 *quadlet = htonl( TICKS_TO_CYCLE_TIMER(ts_frame) ); 286 289 } 287 290 … … 581 584 } 582 585 583 uint64_t ts_head= now_secs*TICKS_PER_SECOND;584 ts_head+=time_to_enable_at*TICKS_PER_CYCLE;586 // uint64_t ts_head= now_secs*TICKS_PER_SECOND; 587 uint64_t ts_head = time_to_enable_at*TICKS_PER_CYCLE; 585 588 586 589 // we also add the nb of cycles we transmit in advance … … 959 962 960 963 //=> convert the SYT to a full timestamp in ticks 961 m_last_timestamp=sytRecvToFullTicks((uint32_t)ntohl(*(quadlet_t *)(data+8)), 962 cycle, m_handler->getCycleTimer()); 964 // m_last_timestamp=sytRecvToFullTicks((uint32_t)ntohl(*(quadlet_t *)(data+8)), 965 // cycle, m_handler->getCycleTimer()); 966 //*** 967 // FIXME: it given that we later advance this to be the timestamp of the sample immediately following 968 // this packet, it perhaps makes more sense to acquire the timestamp of the last frame in the packet. 969 // Then it's just a matter of adding m_ticks_per_frame rather than frame_size times this. 970 uint32_t first_sph = ntohl(*(quadlet_t *)(data+8)); 971 // m_last_timestamp = ((first_sph & 0x1fff000)>>12)*3072 + (first_sph & 0xfff); 972 m_last_timestamp = CYCLE_TIMER_TO_TICKS(first_sph & 0x1ffffff); 963 973 964 974 // Signal that we're running