Changeset 1662


Ignore:
Timestamp:
Jan 4, 2008 5:57:51 PM (11 years ago)
Author:
bennylp
Message:

Fixed timestamp bug in pasound.c: timestamp is shared by both playback and record and it was incorrectly incremented by both

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/pasound.c

    r1638 r1662  
    6262    pjmedia_snd_play_cb  play_cb; 
    6363 
    64     pj_uint32_t          timestamp; 
     64    pj_uint32_t          play_timestamp; 
     65    pj_uint32_t          rec_timestamp; 
    6566    pj_uint32_t          underflow; 
    6667    pj_uint32_t          overflow; 
     
    9091    pj_status_t status; 
    9192 
     93    pj_assert(frameCount == stream->samples_per_frame * stream->channel_count); 
     94 
    9295    PJ_UNUSED_ARG(output); 
    9396    PJ_UNUSED_ARG(timeInfo); 
     
    111114        ++stream->overflow; 
    112115 
    113     stream->timestamp += frameCount; 
    114  
    115     status = (*stream->rec_cb)(stream->user_data, stream->timestamp,  
     116    stream->rec_timestamp += frameCount; 
     117 
     118    status = (*stream->rec_cb)(stream->user_data, stream->rec_timestamp,  
    116119                               (void*)input,  
    117120                               frameCount * stream->bytes_per_sample * 
     
    138141                    stream->channel_count; 
    139142 
     143    pj_assert(frameCount == stream->samples_per_frame * stream->channel_count); 
     144 
    140145    PJ_UNUSED_ARG(input); 
    141146    PJ_UNUSED_ARG(timeInfo); 
     
    159164        ++stream->overflow; 
    160165 
    161     stream->timestamp += frameCount; 
    162  
    163     status = (*stream->play_cb)(stream->user_data, stream->timestamp,  
     166    stream->play_timestamp += frameCount; 
     167 
     168    status = (*stream->play_cb)(stream->user_data, stream->play_timestamp,  
    164169                                output, size); 
    165170     
Note: See TracChangeset for help on using the changeset viewer.