chopmydata: don't mess with adapter from non-streaming thread on FLUSH_START
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 30 Apr 2011 18:08:25 +0000 (19:08 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 30 Apr 2011 18:08:25 +0000 (19:08 +0100)
Don't try to push remaining data in the adapter on receiving a FLUSH event,
just flush the adapter. Do this on FLUSH_STOP, however, which is serialized,
unlike FLUSH_START, so we don't mess with the adapter at the same time as
the streaming thread.

gst/debugutils/gstchopmydata.c

index 0d50571d698d9c4182a4a70d54209493551c5c27..49fc083a18e2de4685a886a3c5b2790bd8af4ae9 100644 (file)
@@ -337,11 +337,10 @@ gst_chop_my_data_sink_event (GstPad * pad, GstEvent * event)
 
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_FLUSH_START:
-      /* FIXME: I don't think it should be doing this in FLUSH_START */
-      gst_chop_my_data_process (chopmydata, TRUE);
       res = gst_pad_push_event (chopmydata->srcpad, event);
       break;
     case GST_EVENT_FLUSH_STOP:
+      gst_adapter_clear (chopmydata->adapter);
       res = gst_pad_push_event (chopmydata->srcpad, event);
       break;
     case GST_EVENT_NEWSEGMENT: