Commit 60814198 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Don't fail state change methods if the sink pin is not connected.

parent f35e5c4d
...@@ -1300,25 +1300,25 @@ static void test_unconnected_filter_state(void) ...@@ -1300,25 +1300,25 @@ static void test_unconnected_filter_state(void)
ok(state == State_Stopped, "Got state %u.\n", state); ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter); hr = IBaseFilter_Pause(filter);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Paused, "Got state %u.\n", state); ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0); hr = IBaseFilter_Run(filter, 0);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Running, "Got state %u.\n", state); ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter); hr = IBaseFilter_Pause(filter);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Paused, "Got state %u.\n", state); ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter); hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
...@@ -1328,11 +1328,11 @@ static void test_unconnected_filter_state(void) ...@@ -1328,11 +1328,11 @@ static void test_unconnected_filter_state(void)
ok(state == State_Stopped, "Got state %u.\n", state); ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0); hr = IBaseFilter_Run(filter, 0);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Running, "Got state %u.\n", state); ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter); hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
......
...@@ -1043,25 +1043,25 @@ static void test_unconnected_filter_state(void) ...@@ -1043,25 +1043,25 @@ static void test_unconnected_filter_state(void)
ok(state == State_Stopped, "Got state %u.\n", state); ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter); hr = IBaseFilter_Pause(filter);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Paused, "Got state %u.\n", state); ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0); hr = IBaseFilter_Run(filter, 0);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Running, "Got state %u.\n", state); ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter); hr = IBaseFilter_Pause(filter);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Paused, "Got state %u.\n", state); ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter); hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
...@@ -1071,11 +1071,11 @@ static void test_unconnected_filter_state(void) ...@@ -1071,11 +1071,11 @@ static void test_unconnected_filter_state(void)
ok(state == State_Stopped, "Got state %u.\n", state); ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0); hr = IBaseFilter_Run(filter, 0);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Running, "Got state %u.\n", state); ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter); hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
......
...@@ -780,25 +780,25 @@ static void test_unconnected_filter_state(void) ...@@ -780,25 +780,25 @@ static void test_unconnected_filter_state(void)
ok(state == State_Stopped, "Got state %u.\n", state); ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter); hr = IBaseFilter_Pause(filter);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Paused, "Got state %u.\n", state); ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0); hr = IBaseFilter_Run(filter, 0);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Running, "Got state %u.\n", state); ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter); hr = IBaseFilter_Pause(filter);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Paused, "Got state %u.\n", state); ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter); hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
...@@ -808,11 +808,11 @@ static void test_unconnected_filter_state(void) ...@@ -808,11 +808,11 @@ static void test_unconnected_filter_state(void)
ok(state == State_Stopped, "Got state %u.\n", state); ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0); hr = IBaseFilter_Run(filter, 0);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == State_Running, "Got state %u.\n", state); ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter); hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
......
...@@ -1438,7 +1438,7 @@ static HRESULT gstdemux_init_stream(struct strmbase_filter *iface) ...@@ -1438,7 +1438,7 @@ static HRESULT gstdemux_init_stream(struct strmbase_filter *iface)
unsigned int i; unsigned int i;
if (!filter->container) if (!filter->container)
return VFW_E_NOT_CONNECTED; return S_OK;
for (i = 0; i < filter->source_count; ++i) for (i = 0; i < filter->source_count; ++i)
{ {
...@@ -1489,7 +1489,7 @@ static HRESULT gstdemux_start_stream(struct strmbase_filter *iface, REFERENCE_TI ...@@ -1489,7 +1489,7 @@ static HRESULT gstdemux_start_stream(struct strmbase_filter *iface, REFERENCE_TI
GstStateChangeReturn ret; GstStateChangeReturn ret;
if (!filter->container) if (!filter->container)
return VFW_E_NOT_CONNECTED; return S_OK;
if ((ret = gst_element_set_state(filter->container, GST_STATE_PLAYING)) == GST_STATE_CHANGE_FAILURE) if ((ret = gst_element_set_state(filter->container, GST_STATE_PLAYING)) == GST_STATE_CHANGE_FAILURE)
{ {
...@@ -1507,7 +1507,7 @@ static HRESULT gstdemux_stop_stream(struct strmbase_filter *iface) ...@@ -1507,7 +1507,7 @@ static HRESULT gstdemux_stop_stream(struct strmbase_filter *iface)
GstStateChangeReturn ret; GstStateChangeReturn ret;
if (!filter->container) if (!filter->container)
return VFW_E_NOT_CONNECTED; return S_OK;
if ((ret = gst_element_set_state(filter->container, GST_STATE_PAUSED)) == GST_STATE_CHANGE_FAILURE) if ((ret = gst_element_set_state(filter->container, GST_STATE_PAUSED)) == GST_STATE_CHANGE_FAILURE)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment