static void
player_command_locked(enum player_command cmd)
{
	assert(pc.command == PLAYER_COMMAND_NONE);

	pc.command = cmd;
	player_signal();
	player_command_wait_locked();
}
Пример #2
0
static void
player_command_locked(struct player_control *pc, enum player_command cmd)
{
	assert(pc->command == PLAYER_COMMAND_NONE);

	pc->command = cmd;
	player_signal(pc);
	player_command_wait_locked(pc);
}
/**
 * All chunks are full of decoded data; wait for the player to free
 * one.
 */
static enum decoder_command
need_chunks(struct decoder_control *dc, struct input_stream *is, bool do_wait)
{
	if (dc->command == DECODE_COMMAND_STOP ||
	    dc->command == DECODE_COMMAND_SEEK)
		return dc->command;

	if ((is == NULL || !decoder_input_buffer(dc, is)) && do_wait) {
		decoder_wait(dc);
		player_signal();

		return dc->command;
	}

	return DECODE_COMMAND_NONE;
}