summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Smith <msmith@songbirdnest.com>2009-02-12 17:31:50 -0800
committerMichael Smith <msmith@songbirdnest.com>2009-02-12 17:31:50 -0800
commit9eaccf65508891a62d27fc43370b44b872242057 (patch)
tree4a9afeec855e95fe1a5cc8e7d08d61877394f284
parent24e1e955478f19675641aed4b9c638a177609d4a (diff)
downloadgst-plugins-bad-9eaccf65508891a62d27fc43370b44b872242057.tar.gz
gst-plugins-bad-9eaccf65508891a62d27fc43370b44b872242057.tar.bz2
gst-plugins-bad-9eaccf65508891a62d27fc43370b44b872242057.zip
dshowvideosink: Return ASYNC appropriately from change_state.
Make sure we don't do the wrong thing when our base class is returning ASYNC in state changes.
-rw-r--r--sys/dshowvideosink/dshowvideosink.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dshowvideosink/dshowvideosink.cpp b/sys/dshowvideosink/dshowvideosink.cpp
index 0745921c..ae17c271 100644
--- a/sys/dshowvideosink/dshowvideosink.cpp
+++ b/sys/dshowvideosink/dshowvideosink.cpp
@@ -869,7 +869,7 @@ static GstStateChangeReturn
gst_dshowvideosink_change_state (GstElement * element, GstStateChange transition)
{
GstDshowVideoSink *sink = GST_DSHOWVIDEOSINK (element);
- GstStateChangeReturn ret;
+ GstStateChangeReturn ret, rettmp;
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
@@ -878,7 +878,7 @@ gst_dshowvideosink_change_state (GstElement * element, GstStateChange transition
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
ret = gst_dshowvideosink_start_graph (sink);
- if (ret != GST_STATE_CHANGE_SUCCESS)
+ if (ret == GST_STATE_CHANGE_FAILURE)
return ret;
break;
}
@@ -887,10 +887,14 @@ gst_dshowvideosink_change_state (GstElement * element, GstStateChange transition
switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
- ret = gst_dshowvideosink_pause_graph (sink);
+ rettmp = gst_dshowvideosink_pause_graph (sink);
+ if (rettmp == GST_STATE_CHANGE_FAILURE)
+ ret = rettmp;
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- ret = gst_dshowvideosink_stop_graph (sink);
+ rettmp = gst_dshowvideosink_stop_graph (sink);
+ if (rettmp == GST_STATE_CHANGE_FAILURE)
+ ret = rettmp;
break;
case GST_STATE_CHANGE_READY_TO_NULL:
gst_dshowvideosink_clear (sink);