Exemplo n.º 1
0
int tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman)
{
	TSMF_PRESENTATION* presentation;

	DEBUG_DVC("on stream volume");

	presentation = tsmf_presentation_find_by_id(Stream_Pointer(ifman->input));

	if (presentation)
	{
		UINT32 newVolume;
		UINT32 muted;

		Stream_Seek(ifman->input, 16);
		Stream_Read_UINT32(ifman->input, newVolume);
		DEBUG_DVC("on stream volume: new volume=[%d]", newVolume);
		Stream_Read_UINT32(ifman->input, muted);
		DEBUG_DVC("on stream volume: muted=[%d]", muted);
		tsmf_presentation_volume_changed(presentation, newVolume, muted);
	}
	else
	{
		DEBUG_WARN("unknown presentation id");
	}

	ifman->output_pending = TRUE;

	return 0;
}
Exemplo n.º 2
0
/**
 * Function description
 *
 * @return 0 on success, otherwise a Win32 error code
 */
UINT tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman)
{
	TSMF_PRESENTATION* presentation;
	UINT32 newVolume;
	UINT32 muted;

	DEBUG_TSMF("on stream volume");

	if (Stream_GetRemainingLength(ifman->input) < GUID_SIZE + 8)
		return ERROR_INVALID_DATA;

	presentation = tsmf_presentation_find_by_id(Stream_Pointer(ifman->input));

	if (!presentation)
	{
		WLog_ERR(TAG, "unknown presentation id");
		return ERROR_NOT_FOUND;
	}

	Stream_Seek(ifman->input, 16);
	Stream_Read_UINT32(ifman->input, newVolume);
	DEBUG_TSMF("on stream volume: new volume=[%d]", newVolume);
	Stream_Read_UINT32(ifman->input, muted);
	DEBUG_TSMF("on stream volume: muted=[%d]", muted);

	if (!tsmf_presentation_volume_changed(presentation, newVolume, muted))
		return ERROR_INVALID_OPERATION;

	ifman->output_pending = TRUE;

	return 0;
}