pulsesrc: don't assert in get_time() when called after shutdown

Which might happen if the source gets set to NULL state before
the rest of the pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=686985
This commit is contained in:
Tim-Philipp Müller 2012-10-28 00:07:46 +01:00 committed by Tim-Philipp Müller
parent 0de4b76d39
commit cd9706e9e9

View file

@ -1754,6 +1754,9 @@ gst_pulsesrc_get_time (GstClock * clock, GstPulseSrc * src)
{
pa_usec_t time = 0;
if (src->mainloop == NULL)
goto out;
pa_threaded_mainloop_lock (src->mainloop);
if (!src->stream)
goto unlock_and_out;
@ -1772,5 +1775,6 @@ gst_pulsesrc_get_time (GstClock * clock, GstPulseSrc * src)
unlock_and_out:
pa_threaded_mainloop_unlock (src->mainloop);
out:
return time;
}