=== modified file 'grecord/src/gsr-window.c' --- grecord/src/gsr-window.c 2012-10-18 05:04:21 +0000 +++ grecord/src/gsr-window.c 2012-10-18 05:04:23 +0000 @@ -1281,17 +1281,8 @@ GST_DEBUG ("Stopping play pipeline"); set_pipeline_state_to_null (priv->play->pipeline); } else if (priv->record && priv->record->state == GST_STATE_PLAYING) { - GST_DEBUG ("Stopping recording source"); - /* GstBaseSrc will automatically send an EOS when stopping */ - gst_element_set_state (priv->record->src, GST_STATE_NULL); - gst_element_get_state (priv->record->src, NULL, NULL, -1); - gst_element_set_locked_state (priv->record->src, TRUE); - - GST_DEBUG ("Stopping recording pipeline"); - set_pipeline_state_to_null (priv->record->pipeline); - gtk_widget_set_sensitive (window->priv->level, FALSE); - gtk_widget_set_sensitive (window->priv->volume_label, FALSE); - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (window->priv->level), 0.0); + GST_DEBUG ("Sending EOS to recording pipeline"); + gst_element_send_event (priv->record->pipeline, gst_event_new_eos ()); } } @@ -1683,6 +1674,18 @@ GST_DEBUG ("EOS. Finished recording"); + GST_DEBUG ("Stopping recording source"); + /* GstBaseSrc will automatically send an EOS when stopping */ + gst_element_set_state (window->priv->record->src, GST_STATE_NULL); + gst_element_get_state (window->priv->record->src, NULL, NULL, -1); + gst_element_set_locked_state (window->priv->record->src, TRUE); + + GST_DEBUG ("Stopping recording pipeline"); + set_pipeline_state_to_null (window->priv->record->pipeline); + gtk_widget_set_sensitive (window->priv->level, FALSE); + gtk_widget_set_sensitive (window->priv->volume_label, FALSE); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (window->priv->level), 0.0); + /* FIXME: this was READY before (why?) */ set_pipeline_state_to_null (window->priv->record->pipeline);