Changeset 50873 in webkit


Ignore:
Timestamp:
Nov 12, 2009 2:39:57 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-12 Philippe Normand <pnormand@igalia.com>

Reviewed by Jan Alonzo.

https://bugs.webkit.org/show_bug.cgi?id=31047
[GTK] Failing test media/video-played-ranges-1.html

Follow-up of r50726, don't block the UI thread when calling
gst_element_get_state(). Also fixed a compilation warning and some
static casts.

  • platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: (WebCore::playbackPosition): (WebCore::MediaPlayerPrivate::seek): (WebCore::MediaPlayerPrivate::setRate):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50872 r50873  
     12009-11-12  Philippe Normand  <pnormand@igalia.com>
     2
     3        Reviewed by Jan Alonzo.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=31047
     6        [GTK] Failing test media/video-played-ranges-1.html
     7
     8        Follow-up of r50726, don't block the UI thread when calling
     9        gst_element_get_state(). Also fixed a compilation warning and some
     10        static casts.
     11
     12        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
     13        (WebCore::playbackPosition):
     14        (WebCore::MediaPlayerPrivate::seek):
     15        (WebCore::MediaPlayerPrivate::setRate):
     16
    1172009-11-12  Philippe Normand  <pnormand@igalia.com>
    218
  • trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp

    r50872 r50873  
    117117    // Position is available only if the pipeline is not in NULL or
    118118    // READY state.
    119     if (position != GST_CLOCK_TIME_NONE)
    120         ret = (float) (position / 1000000000.0);
     119    if (position !=  static_cast<gint64>(GST_CLOCK_TIME_NONE))
     120        ret = static_cast<float>(position) / static_cast<float>(GST_SECOND);
    121121
    122122    LOG_VERBOSE(Media, "Position %" GST_TIME_FORMAT, GST_TIME_ARGS(position));
     
    392392    GstState pending;
    393393
    394     gst_element_get_state(m_playBin,
    395         &state, &pending, 250 * GST_NSECOND);
    396     if (state != GST_STATE_PLAYING && state != GST_STATE_PAUSED)
     394    gst_element_get_state(m_playBin, &state, &pending, 0);
     395    if ((state != GST_STATE_PLAYING && state != GST_STATE_PAUSED)
     396        || (pending == GST_STATE_PAUSED))
    397397        return;
    398398
     
    419419        // If we are at beginning of media, start from the end to
    420420        // avoid immediate EOS.
    421         if (currentPosition == 0 || currentPosition == -1)
     421        if (currentPosition <= 0)
    422422            end = duration() * GST_SECOND;
    423423        else
     
    431431                          GST_SEEK_TYPE_SET, end))
    432432        LOG_VERBOSE(Media, "Set rate to %f failed", rate);
    433     else {
     433    else
    434434        g_object_set(m_playBin, "mute", mute, NULL);
    435         // Wait some time for the seek to complete.
    436         gst_element_get_state(m_playBin, 0, 0, 40 * GST_MSECOND);
    437     }
    438435}
    439436
Note: See TracChangeset for help on using the changeset viewer.