Changeset 1791 for pjproject


Ignore:
Timestamp:
Feb 14, 2008 9:57:05 AM (17 years ago)
Author:
bennylp
Message:

Handle short files in WAV player

File:
1 edited

Legend:

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

    r1690 r1791  
    329329        return PJMEDIA_EWAVEUNSUPP; 
    330330    } 
    331     if (wave_hdr.data_hdr.len < 400) { 
     331    if (wave_hdr.data_hdr.len < 200) { 
    332332        pj_file_close(fport->fd); 
    333333        return PJMEDIA_EWAVETOOSHORT; 
     
    351351 
    352352    pj_strdup2(pool, &fport->base.info.name, filename); 
     353 
     354    /* If file is shorter than buffer size, adjust buffer size to file 
     355     * size. Otherwise EOF callback will be called multiple times when 
     356     * fill_buffer() is called. 
     357     */ 
     358    if (wave_hdr.data_hdr.len < (unsigned)buff_size) 
     359        buff_size = wave_hdr.data_hdr.len; 
    353360 
    354361    /* Create file buffer. 
Note: See TracChangeset for help on using the changeset viewer.