Changeset 1685


Ignore:
Timestamp:
Jan 12, 2008 3:30:15 PM (11 years ago)
Author:
bennylp
Message:

Another fix for ticket #447: WAV player cuts last data from the WAV file

File:
1 edited

Legend:

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

    r1683 r1685  
    516516    pj_assert(fport->base.info.signature == SIGNATURE); 
    517517 
    518     /* Check EOF */ 
    519     if (fport->eof) { 
    520         frame->type = PJMEDIA_FRAME_TYPE_NONE; 
    521         frame->size = 0; 
    522         return PJ_EEOF; 
    523     } 
    524  
    525518    //frame_size = fport->base.info.bytes_per_frame; 
    526519    //pj_assert(frame->size == frame_size); 
     
    561554        status = fill_buffer(fport); 
    562555        if (status != PJ_SUCCESS) { 
    563             pj_bzero(((char*)frame->buf)+endread, frame_size-endread); 
     556            /* If we don't get anything, return NONE frame. Otherwise 
     557             * return AUDIO frame since we have partial audio. 
     558             */ 
     559            if (endread == 0) { 
     560                frame->type = PJMEDIA_FRAME_TYPE_NONE; 
     561            } else { 
     562                pj_bzero(((char*)frame->buf)+endread, frame_size-endread); 
     563            } 
    564564            fport->readpos = fport->buf + fport->bufsize; 
    565             return status; 
     565            return PJ_SUCCESS; 
    566566        } 
    567567 
Note: See TracChangeset for help on using the changeset viewer.