Skip to content
  • philn@webkit.org's avatar
    [GStreamer] Audio device not closed after playing sound · 7b5fda83
    philn@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=89122
    
    Reviewed by Martin Robinson.
    
    Set the GStreamer pipeline to NULL instead of PAUSED on EOS. This
    allows the audio-sink to release its connection to the audio
    device. This is done only if the Media element is not
    looping. To make the MediaPlayerPrivate layer aware of that
    information the MediaPlayerClient interface was updated with a new
    method mediaPlayerIsLooping, implemented by the HTMLMediaElement.
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::mediaPlayerIsLooping): Implementation of
    MediaPlayerClient::mediaPlayerLoop, proxies to ::loop();
    * html/HTMLMediaElement.h:
    (HTMLMediaElement):
    * platform/graphics/MediaPlayer.h:
    (WebCore::MediaPlayerClient::mediaPlayerIsLooping): New method allowing
    the MediaPlayer and its backend to know if a playback loop is
    requested by the client.
    * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
    (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
    (WebCore::MediaPlayerPrivateGStreamer::playbackPosition): Report
    seek time or media duration if EOS was reached. These early
    returns are needed because the position query doesn't work on a
    NULL pipeline.
    (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
    Refactored to use an early return.
    (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Reset the
    seeking flag.
    (WebCore::MediaPlayerPrivateGStreamer::play): reset m_isEndReached.
    (WebCore::MediaPlayerPrivateGStreamer::pause): Don't pause on EOS.
    (WebCore::MediaPlayerPrivateGStreamer::seek): Refactor, call
    currentTime() after we're sure playbin is valid and no error occured.
    (WebCore::MediaPlayerPrivateGStreamer::paused): Fake paused state
    on EOS.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    7b5fda83