PJ_DEF(pj_status_t) pjmedia_wav_player_port_set_pos(pjmedia_port *port,
						    pj_uint32_t bytes )
{
    struct file_reader_port *fport;
    pj_status_t status;

    /* Sanity check */
    PJ_ASSERT_RETURN(port, PJ_EINVAL);

    /* Check that this is really a player port */
    PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, PJ_EINVALIDOP);


    fport = (struct file_reader_port*) port;

    /* Check that this offset does not pass the audio-data (in case of
     * extra chunk after audio data chunk
     */
    PJ_ASSERT_RETURN(bytes < fport->data_len, PJ_EINVAL);

    fport->fpos = fport->start_data + bytes;
    fport->data_left = fport->data_len - bytes;
    pj_file_setpos( fport->fd, fport->fpos, PJ_SEEK_SET);

    fport->eof = PJ_FALSE;
    status = fill_buffer(fport);
    if (status != PJ_SUCCESS)
	return status;

    fport->readpos = fport->buf;

    return PJ_SUCCESS;
}
PJ_DEF(pj_status_t) pjmedia_wav_player_port_set_pos(pjmedia_port *port,
						    pj_uint32_t bytes )
{
    struct file_reader_port *fport;
    pj_status_t status;

     
    PJ_ASSERT_RETURN(port, PJ_EINVAL);

     
    PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, PJ_EINVALIDOP);


    fport = (struct file_reader_port*) port;

     
    PJ_ASSERT_RETURN(bytes < fport->data_len, PJ_EINVAL);

    fport->fpos = fport->start_data + bytes;
    fport->data_left = fport->data_len - bytes;
    pj_file_setpos( fport->fd, fport->fpos, PJ_SEEK_SET);

    fport->eof = PJ_FALSE;
    status = fill_buffer(fport);
    if (status != PJ_SUCCESS)
	return status;

    fport->readpos = fport->buf;

    return PJ_SUCCESS;
}