a/sc2src/sc2mpd.cpp b/sc2src/sc2mpd.cpp
...
...
193
193
194
// Debug and stats only, not needed for main function
194
// Debug and stats only, not needed for main function
195
void OhmReceiverDriver::Observer::process(OhmMsgAudio& aMsg)
195
void OhmReceiverDriver::Observer::process(OhmMsgAudio& aMsg)
196
{
196
{
197
    if (++iCount == 400 || aMsg.Halt()) {
197
    if (++iCount == 400 || aMsg.Halt()) {
198
        static unsigned long long last_timestamp;
199
        unsigned long long timestamp = aMsg.MediaTimestamp();
200
        LOGDEB("OhmRcvDrv::Process:audio: samplerate " << aMsg.SampleRate() <<
198
        LOGDEB("OhmRcvDrv::Process:audio: samplerate " << aMsg.SampleRate() <<
201
               " bitdepth " << aMsg.BitDepth() << " channels " <<
199
               " bitdepth " << aMsg.BitDepth() << " channels " <<
202
               aMsg.Channels() << " samples " << aMsg.Samples() << 
200
               aMsg.Channels() << " samples " << aMsg.Samples() << 
203
               " Halted ? " << aMsg.Halt() << endl);
201
               " Halted ? " << aMsg.Halt() << endl);
204
202
203
#if 0
204
        static unsigned long long last_timestamp;
205
        unsigned long long timestamp = aMsg.MediaTimestamp();
205
        if (last_timestamp) {
206
        if (last_timestamp) {
206
            long long intervalus = 
207
            long long intervalus = 
207
                ((timestamp - last_timestamp) * 1000000) / (256*48000);
208
                ((timestamp - last_timestamp) * 1000000) / (256*48000);
208
            long long atsus = 
209
            long long atsus = 
209
                ((timestamp) * 1000000) / (256*48000);
210
                ((timestamp) * 1000000) / (256*48000);
211
212
            // Not too sure what this did. amicros not in chrono.cpp any more
210
            long long absus = chron.amicros() - 1430477861905884LL;
213
            long long absus = chron.amicros() - 1430477861905884LL;
211
            LOGDEB("Computed-uS: " << intervalus  << 
214
            LOGDEB("Computed-uS: " << intervalus  << 
212
                   " Elapsed-uS: " << chron.urestart() << 
215
                   " Elapsed-uS: " << chron.urestart() << 
213
                   " Timestamp-uS: " << atsus <<
216
                   " Timestamp-uS: " << atsus <<
214
                   " Abs-uS: " << absus << 
217
                   " Abs-uS: " << absus << 
215
                   " Diff-mS " << (absus - atsus) / 1000 <<
218
                   " Diff-mS " << (absus - atsus) / 1000 <<
216
                   endl);
219
                   endl);
217
        }
220
        }
218
        last_timestamp = timestamp;
221
        last_timestamp = timestamp;
222
#endif
219
223
220
        if (!aMsg.Halt()) {
224
        if (!aMsg.Halt()) {
221
            unsigned int bytes = 
225
            unsigned int bytes = 
222
                aMsg.Samples() * (aMsg.BitDepth() / 8) * aMsg.Channels();
226
                aMsg.Samples() * (aMsg.BitDepth() / 8) * aMsg.Channels();
223
227