Ignore:
Timestamp:
Jan 12, 2008 11:11:58 AM (11 years ago)
Author:
bennylp
Message:

Added new WAV player API: pjmedia_wav_player_get_len()

File:
1 edited

Legend:

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

    r1417 r1680  
    401401 
    402402/* 
     403 * Get the data length, in bytes. 
     404 */ 
     405PJ_DEF(pj_ssize_t) pjmedia_wav_player_get_len(pjmedia_port *port) 
     406{ 
     407    struct file_port *fport; 
     408    pj_ssize_t size; 
     409 
     410    /* Sanity check */ 
     411    PJ_ASSERT_RETURN(port, -PJ_EINVAL); 
     412 
     413    /* Check that this is really a player port */ 
     414    PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, -PJ_EINVALIDOP); 
     415 
     416    fport = (struct file_port*) port; 
     417 
     418    size = (pj_ssize_t) fport->fsize; 
     419    return size - fport->start_data; 
     420} 
     421 
     422 
     423/* 
    403424 * Set position. 
    404425 */ 
     
    409430 
    410431    /* Sanity check */ 
    411     PJ_ASSERT_RETURN(port, -PJ_EINVAL); 
     432    PJ_ASSERT_RETURN(port, PJ_EINVAL); 
    412433 
    413434    /* Check that this is really a player port */ 
    414     PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, -PJ_EINVALIDOP); 
     435    PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, PJ_EINVALIDOP); 
    415436 
    416437 
Note: See TracChangeset for help on using the changeset viewer.