[GStreamer] Crash in AudioTrackPrivate with playbin3 enabled
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Apr 2019 12:11:50 +0000 (12:11 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Apr 2019 12:11:50 +0000 (12:11 +0000)
commitfaadc839de526f04c1388045b8fcb64be74d6d7c
tree843e6bdb1f874578894a36faed50a062a9a9b388
parent4a405c794b5f90db6962444a5d529f7fc1fc90c5
[GStreamer] Crash in AudioTrackPrivate with playbin3 enabled
https://bugs.webkit.org/show_bug.cgi?id=196913

Reviewed by Xabier Rodriguez-Calvar.

The crash was due to a playbin3 code path being triggered during
MSE playback, which is not supposed to work in playbin3 anyway.
The problem is that setting the USE_PLAYBIN3 environment variable
to "1" makes the GStreamer playback plugin register the playbin3
element under the playbin name. So that leads to playbin3 being
used everywhere in WebKit where we assume the playbin element is
used. So the proposed solution is to:

- use a WebKit-specific environment variable instead of the
GStreamer USE_PLAYBIN3 variable.
- emit a warning if the USE_PLAYBIN3 environment variable is
detected. We can't unset it ourselves for security reasons.

The patch also includes a code cleanup of the player method
handling the pipeline creation. The previous code had a bug
leading to playbin3 being used for MSE.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h