Beispiel #1
0
/*
 * cmyth_livetv_seek(cmyth_recorder_t file, long long offset, int whence)
 * 
 * Scope: PUBLIC
 *
 * Description
 *
 * Seek to a new position in the file based on the value of whence:
 *	SEEK_SET
 *		The offset is set to offset bytes.
 *	SEEK_CUR
 *		The offset is set to the current position plus offset bytes.
 *	SEEK_END
 *		The offset is set to the size of the file minus offset bytes.
 * This function will select the appropriate call based on the protocol.
 *
 * Return Value:
 *
 * Sucess: 0
 *
 * Failure: an int containing -errno
 */
long long
cmyth_livetv_seek(cmyth_recorder_t rec, long long offset, int whence)
{
	long long rtrn;

	if(rec->rec_conn->conn_version >= 26)
		rtrn = cmyth_livetv_chain_seek(rec, offset, whence);
	else
		rtrn = cmyth_ringbuf_seek(rec, offset, whence);

	return rtrn;
}
Beispiel #2
0
/*
 * cmyth_livetv_seek(cmyth_recorder_t file, long long offset, int whence)
 *
 * Scope: PUBLIC
 *
 * Description
 *
 * Seek to a new position in the file based on the value of whence:
 *	SEEK_SET
 *		The offset is set to offset bytes.
 *	SEEK_CUR
 *		The offset is set to the current position plus offset bytes.
 *	SEEK_END
 *		The offset is set to the size of the file minus offset bytes.
 * This function will select the appropriate call based on the protocol.
 *
 * Return Value:
 *
 * Sucess: 0
 *
 * Failure: an int containing -errno
 */
long long
cmyth_livetv_seek(cmyth_recorder_t rec, long long offset, int whence)
{
    long long rtrn;

    if (!rec->rec_connected) {
        return -1;
    }

    if (rec->rec_conn->conn_version >= 26) {
        rtrn = cmyth_livetv_chain_seek(rec, offset, whence);
    } else {
        rtrn = cmyth_ringbuf_seek(rec, offset, whence);
    }

    return rtrn;
}