Problem ending filesink

yoyosuper8 yoyosuper8 at yahoo.com
Sat Nov 16 21:42:07 PST 2013


I'm wondering if it is maybe because of how I'm ending the recording section.
Here is my code on how I'm ending the pipeline:

    static void finalize_recording() {
        gst_element_send_event(rec->pipeline, gst_event_new_eos());

        // quitting main loop
        g_main_loop_quit (rec->main_loop);
        pthread_join (gst_record_thread, NULL);

        g_free (rec);
    }

    static void record_thread() {
        ...

        // Create GMainLoop and set it to run
        rec->main_loop = g_main_loop_new (rec->main_context, FALSE);
        g_main_loop_run (rec->main_loop);

        g_main_loop_unref (rec->main_loop);
        rec->main_loop = NULL;

        // free resources
        g_main_context_unref (rec->main_context);
        gst_element_set_state (rec->pipeline, GST_STATE_NULL);
        gst_object_unref (rec->pipeline);

    }


So when I'm reading to stop recording I call the function
finalize_recording() which sends the EOS message thru the pipeline, but then
it stops the main loop that is running the pipeline. Then the
record_thread() function starts to clear the pipeline and freeing other
elements.
I'm wondering if I'm not giving it enough time to perform the EOS and end
the file saving process before I start clearing the pipeline and killing the
thread.
Any ideas? 

Thank you 
Andy



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Problem-ending-filesink-tp4663362p4663373.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list