Changeset 138364 in webkit


Ignore:
Timestamp:
Dec 21, 2012 2:46:53 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer] Buffering ranges are reported incorrectly with GStreamer 1.0
https://bugs.webkit.org/show_bug.cgi?id=105319

Patch by Xabier Rodriguez Calvar <calvaris@igalia.com> on 2012-12-21
Reviewed by Philippe Normand.

We add the gPercentMax constant to select between 100 and
GST_FORMAT_PERCENT_MAX depending if we are compiling against
GStreamer 0.10 or 1.0 and we use that in the corresponding method.

Current tests should suffice.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::buffered): Added the use of
gPercentMax constant instead of 100 to have the different code
paths for GStreamer 0.10 and 1.0.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r138361 r138364  
     12012-12-21  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [GStreamer] Buffering ranges are reported incorrectly with GStreamer 1.0
     4        https://bugs.webkit.org/show_bug.cgi?id=105319
     5
     6        Reviewed by Philippe Normand.
     7
     8        We add the gPercentMax constant to select between 100 and
     9        GST_FORMAT_PERCENT_MAX depending if we are compiling against
     10        GStreamer 0.10 or 1.0 and we use that in the corresponding method.
     11
     12        Current tests should suffice.
     13
     14        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     15        (WebCore::MediaPlayerPrivateGStreamer::buffered): Added the use of
     16        gPercentMax constant instead of 100 to have the different code
     17        paths for GStreamer 0.10 and 1.0.
     18
    1192012-12-21  Tim Horton  <timothy_horton@apple.com>
    220
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r137925 r138364  
    7676} GstPlayFlags;
    7777
     78// gPercentMax is used when parsing buffering ranges with
     79// gst_query_parse_nth_buffering_range as there was a bug in GStreamer
     80// 0.10 that was using 100 instead of GST_FORMAT_PERCENT_MAX. This was
     81// corrected in 1.0. gst_query_parse_buffering_range worked as
     82// expected with GST_FORMAT_PERCENT_MAX in both cases.
    7883#ifdef GST_API_VERSION_1
    7984static const char* gPlaybinName = "playbin";
     85static const gint64 gPercentMax = GST_FORMAT_PERCENT_MAX;
    8086#else
    8187static const char* gPlaybinName = "playbin2";
     88static const gint64 gPercentMax = 100;
    8289#endif
    8390
     
    759766    }
    760767
    761     gint64 rangeStart = 0, rangeStop = 0;
    762768    for (guint index = 0; index < gst_query_get_n_buffering_ranges(query); index++) {
     769        gint64 rangeStart = 0, rangeStop = 0;
    763770        if (gst_query_parse_nth_buffering_range(query, index, &rangeStart, &rangeStop))
    764             timeRanges->add(static_cast<float>((rangeStart * mediaDuration) / 100),
    765                             static_cast<float>((rangeStop * mediaDuration) / 100));
     771            timeRanges->add(static_cast<float>((rangeStart * mediaDuration) / gPercentMax),
     772                static_cast<float>((rangeStop * mediaDuration) / gPercentMax));
    766773    }
    767774
Note: See TracChangeset for help on using the changeset viewer.