⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236264 in webkit


Ignore:
Timestamp:
Sep 20, 2018, 9:46:58 AM (8 years ago)
Author:
aboya@igalia.com
Message:

[GStreamer][MSE] Add a default sample duration
​https://bugs.webkit.org/show_bug.cgi?id=189788

Some WebM files don't provide sample durations, so we need to provide
a safe default in order for them to be playable.

Reviewed by Michael Catanzaro.

  • platform/graphics/gstreamer/MediaSampleGStreamer.cpp:

(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r236258 r236264  
     12018-09-20  Alicia Boya García  <aboya@igalia.com>
     2
     3        [GStreamer][MSE] Add a default sample duration
     4        https://bugs.webkit.org/show_bug.cgi?id=189788
     5
     6        Some WebM files don't provide sample durations, so we need to provide
     7        a safe default in order for them to be playable.
     8
     9        Reviewed by Michael Catanzaro.
     10
     11        * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
     12        (WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
     13
    1142018-09-20  Alicia Boya García  <aboya@igalia.com>
    215
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.cpp

    r230625 r236264  
    5151    if (GST_BUFFER_DURATION_IS_VALID(buffer))
    5252        m_duration = createMediaTime(GST_BUFFER_DURATION(buffer));
     53    else {
     54        // Unfortunately, sometimes samples don't provide a duration. This can never happen in MP4 because of the way
     55        // the format is laid out, but it's pretty common in WebM.
     56        // The good part is that durations don't matter for playback, just for buffered ranges and coded frame deletion.
     57        // We want to pick something small enough to not cause unwanted frame deletion, but big enough to never be
     58        // mistaken for a rounding artifact.
     59        m_duration = createMediaTime(16666667); // 1/60 seconds
     60    }
    5361
    5462    m_size = gst_buffer_get_size(buffer);
Note: See TracChangeset for help on using the changeset viewer.