Index: /branches/streaming-rework/src/libstreaming/MotuStreamProcessor.cpp =================================================================== --- /branches/streaming-rework/src/libstreaming/MotuStreamProcessor.cpp (revision 425) +++ /branches/streaming-rework/src/libstreaming/MotuStreamProcessor.cpp (revision 428) @@ -917,7 +917,11 @@ // because we're going to update the buffer again this loop // using writeframes - m_data_buffer->setBufferTailTimestamp(m_last_timestamp2); - -debugOutput(DEBUG_LEVEL_VERBOSE,"On enable: last ts2=%lld\n",m_last_timestamp2); +// m_data_buffer->setBufferTailTimestamp(m_last_timestamp2); + m_data_buffer->setBufferTailTimestamp(m_last_timestamp); + +debugOutput(DEBUG_LEVEL_VERBOSE,"On enable: last ts=%lld, ts2=%lld = %lld (%p)\n", + m_last_timestamp, m_last_timestamp2, m_last_timestamp-m_last_timestamp2, + m_data_buffer); + } else { debugOutput(DEBUG_LEVEL_VERY_VERBOSE, @@ -965,4 +969,5 @@ // Then it's just a matter of adding m_ticks_per_frame rather than frame_size times this. uint32_t first_sph = ntohl(*(quadlet_t *)(data+8)); +//uint32_t first_sph = ntohl(*(quadlet_t *)(data+8+(event_length*(n_events-1)))); // m_last_timestamp = ((first_sph & 0x1fff000)>>12)*3072 + (first_sph & 0xfff); m_last_timestamp = CYCLE_TIMER_TO_TICKS(first_sph & 0x1ffffff); @@ -987,4 +992,6 @@ uint64_t ts=addTicks(m_last_timestamp, (uint64_t)(frame_size * m_ticks_per_frame)); +// uint64_t ts=addTicks(m_last_timestamp, +// (uint64_t)(m_ticks_per_frame)); // set the timestamp as if there will be a sample put into @@ -993,5 +1000,5 @@ ts -= TICKS_PER_SECOND; m_data_buffer->setBufferTailTimestamp(ts); -debugOutput(DEBUG_LEVEL_VERBOSE,"%p, last ts=%lld, ts=%lld, lts2=%lld\n", m_data_buffer, m_last_timestamp, ts, m_last_timestamp2); +//debugOutput(DEBUG_LEVEL_VERBOSE,"%p, last ts=%lld, ts=%lld, lts2=%lld\n", m_data_buffer, m_last_timestamp, ts, m_last_timestamp2); return RAW1394_ISO_DEFER; @@ -999,5 +1006,5 @@ debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "put packet...\n"); -debugOutput(DEBUG_LEVEL_VERBOSE,"enabled: %p, last ts=%lld, ts2=%lld\n",m_data_buffer, m_last_timestamp, m_last_timestamp2); +//debugOutput(DEBUG_LEVEL_VERBOSE,"enabled: %p, last ts=%lld, ts2=%lld\n",m_data_buffer, m_last_timestamp, m_last_timestamp2); //=> process the packet Index: /branches/streaming-rework/src/libstreaming/StreamProcessor.cpp =================================================================== --- /branches/streaming-rework/src/libstreaming/StreamProcessor.cpp (revision 424) +++ /branches/streaming-rework/src/libstreaming/StreamProcessor.cpp (revision 428) @@ -73,5 +73,6 @@ IsoStream::dumpInfo(); debugOutputShort( DEBUG_LEVEL_NORMAL, " StreamProcessor info:\n"); - debugOutputShort( DEBUG_LEVEL_NORMAL, " Now : %011u\n",m_handler->getCycleTimerTicks()); + if (m_handler) + debugOutputShort( DEBUG_LEVEL_NORMAL, " Now : %011u\n",m_handler->getCycleTimerTicks()); debugOutputShort( DEBUG_LEVEL_NORMAL, " Xruns : %d\n", m_xruns); debugOutputShort( DEBUG_LEVEL_NORMAL, " Running : %d\n", m_running); Index: /branches/streaming-rework/src/motu/motu_avdevice.cpp =================================================================== --- /branches/streaming-rework/src/motu/motu_avdevice.cpp (revision 426) +++ /branches/streaming-rework/src/motu/motu_avdevice.cpp (revision 428) @@ -73,11 +73,9 @@ // Free ieee1394 bus resources if they have been allocated if (m_p1394Service != NULL) { - if(m_p1394Service->freeIsoChannel(m_iso_recv_channel)) { + if (m_iso_recv_channel>=0 && m_p1394Service->freeIsoChannel(m_iso_recv_channel)) { debugOutput(DEBUG_LEVEL_VERBOSE, "Could not free recv iso channel %d\n", m_iso_recv_channel); - } - if(m_p1394Service->freeIsoChannel(m_iso_send_channel)) { + if (m_iso_send_channel>=0 && m_p1394Service->freeIsoChannel(m_iso_send_channel)) { debugOutput(DEBUG_LEVEL_VERBOSE, "Could not free send iso channel %d\n", m_iso_send_channel); - } }