Bug 139496 - [GStreamer] Fix deadlock when shutting down AudioDestination
Summary: [GStreamer] Fix deadlock when shutting down AudioDestination
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Major
Assignee: Sebastian Dröge (slomo)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-10 10:52 PST by Sebastian Dröge (slomo)
Modified: 2014-12-16 00:17 PST (History)
2 users (show)

See Also:


Attachments
Patch (4.51 KB, patch)
2014-12-10 10:53 PST, Sebastian Dröge (slomo)
no flags Details | Formatted Diff | Diff
Patch (4.55 KB, patch)
2014-12-12 11:06 PST, Sebastian Dröge (slomo)
no flags Details | Formatted Diff | Diff
Patch (4.59 KB, patch)
2014-12-15 10:19 PST, Sebastian Dröge (slomo)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Dröge (slomo) 2014-12-10 10:52:36 PST
Patch coming soon
Comment 1 Sebastian Dröge (slomo) 2014-12-10 10:53:49 PST
Created attachment 243048 [details]
Patch
Comment 2 Sebastian Dröge (slomo) 2014-12-10 11:01:30 PST
The GStreamer bug will be fixed in 1.4.5:
https://bugzilla.gnome.org/show_bug.cgi?id=740001
Comment 3 Philippe Normand 2014-12-11 23:56:11 PST
Comment on attachment 243048 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=243048&action=review

Looks good, thanks! Just a few nits to brag about :)

> Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:343
> +            // FLUSHING and EOS are no errors

are not errors.

> Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:378
> +                // FLUSHING and EOS are no errors

Ditto :)

> Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:385
> +        } else {
> +            gst_buffer_unref(channelBuffer);
>          }

for one-line blocks we don't use {} usually.
Comment 4 Sebastian Dröge (slomo) 2014-12-12 01:10:09 PST
(In reply to comment #3)

> > Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:385
> > +        } else {
> > +            gst_buffer_unref(channelBuffer);
> >          }
> 
> for one-line blocks we don't use {} usually.

Even for cases like

if (foo) {
    multiple
    lines
} else
  one_line

? I'll change that later when I'm at my laptop again. Thanks for the fast review :)
Comment 5 Philippe Normand 2014-12-12 01:20:38 PST
Yep but you can double-check with the check-webkit-style script.
Comment 6 Sebastian Dröge (slomo) 2014-12-12 11:06:41 PST
Created attachment 243206 [details]
Patch
Comment 7 Philippe Normand 2014-12-14 23:28:09 PST
Comment on attachment 243206 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=243206&action=review

> Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:429
> +        gst_buffer_pool_set_flushing(src->priv->pool, TRUE);

Seems like an #ifdef is needed here to make EFL EWS happy... Unless they bump their jhbuild gstreamer version to 1.4.x but that's not up to me to decide :)
Comment 8 Sebastian Dröge (slomo) 2014-12-15 00:04:50 PST
(In reply to comment #7)
> Comment on attachment 243206 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=243206&action=review
> 
> > Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:429
> > +        gst_buffer_pool_set_flushing(src->priv->pool, TRUE);
> 
> Seems like an #ifdef is needed here to make EFL EWS happy... Unless they
> bump their jhbuild gstreamer version to 1.4.x but that's not up to me to
> decide :)

An #ifdef should be fine. That's really just an optimization in the end :) If we're shutting down, gst_buffer_pool_acquire() would return FLUSHING afterwards and we would go out of the srcpad loop earlier... instead of going out of it when trying to push buffers to the appsrcs.
Comment 9 Sebastian Dröge (slomo) 2014-12-15 10:19:38 PST
Created attachment 243300 [details]
Patch
Comment 10 WebKit Commit Bot 2014-12-16 00:17:12 PST
Comment on attachment 243300 [details]
Patch

Clearing flags on attachment: 243300

Committed r177341: <http://trac.webkit.org/changeset/177341>
Comment 11 WebKit Commit Bot 2014-12-16 00:17:17 PST
All reviewed patches have been landed.  Closing bug.