Beispiel #1
0
/*
 * cmyth_proginfo_length_sec(cmyth_proginfo_t prog)
 *
 *
 * Scope: PUBLIC
 *
 * Description
 *
 * Retrieves the program length in seconds.
 *
 * Return Value:
 *
 * Success: int file length
 *
 * Failure: NULL
 */
int
cmyth_proginfo_length_sec(cmyth_proginfo_t prog)
{
	int seconds;

	if (!prog) {
		return -1;
	}

	seconds = cmyth_timestamp_diff(prog->proginfo_start_ts,
				       prog->proginfo_end_ts);

	return seconds;
}
Beispiel #2
0
/*
 * cmyth_proginfo_length_sec()
 *
 *
 * Scope: PUBLIC
 *
 * Description
 *
 * Retrieves the program length in seconds.
 *
 * Return Value:
 *
 * Success: int file length
 *
 * Failure: 0
 */
uint32_t
cmyth_proginfo_length_sec(cmyth_proginfo_t prog)
{
	int seconds;

	if (!prog) {
		return 0;
	}

	seconds = cmyth_timestamp_diff(prog->proginfo_start_ts,
				       prog->proginfo_end_ts);
	if (seconds < 0) {
		return 0;
	}
	return (uint32_t)seconds;
}