[Nice] [nice/master] return WRONG_STATE if unlocked and do not modify flow_ret from outside the streaming thread

Youness Alaoui youness.alaoui at collabora.co.uk
Wed Nov 5 14:01:02 PST 2008


darcs-hash:20080423001715-4f0f6-aedb50231ebdb4f1296d4e98e91fd675453c97a7.gz
---
 gst/gstnicesrc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gst/gstnicesrc.c b/gst/gstnicesrc.c
index b7f9216..d3c6dda 100644
--- a/gst/gstnicesrc.c
+++ b/gst/gstnicesrc.c
@@ -220,7 +220,6 @@ gst_nice_src_unlock (GstBaseSrc *src)
 
   GST_OBJECT_LOCK (src);
   nicesrc->unlocked = TRUE;
-  nicesrc->flow_ret = GST_FLOW_WRONG_STATE;
 
   g_main_loop_quit (nicesrc->mainloop);
 
@@ -240,7 +239,6 @@ gst_nice_src_unlock_stop (GstBaseSrc *src)
 
   GST_OBJECT_LOCK (src);
   nicesrc->unlocked = FALSE;
-  nicesrc->flow_ret = GST_FLOW_OK;
   g_source_destroy (nicesrc->idle_source);
   nicesrc->idle_source = NULL;
   GST_OBJECT_UNLOCK (src);
@@ -263,7 +261,7 @@ gst_nice_src_create (
   GST_OBJECT_LOCK (basesrc);
   if (nicesrc->unlocked) {
     GST_OBJECT_UNLOCK (basesrc);
-    return nicesrc->flow_ret;
+    return GST_FLOW_WRONG_STATE;
   }
   GST_OBJECT_UNLOCK (basesrc);
 
@@ -271,9 +269,11 @@ gst_nice_src_create (
 
   if (nicesrc->outbuf) {
     *buffer = nicesrc->outbuf;
+    return nicesrc->flow_ret;
+  } else {
+    return GST_FLOW_WRONG_STATE;
   }
 
-  return nicesrc->flow_ret;
 }
 
 static void
-- 
1.5.6.5




More information about the Nice mailing list