Changeset 148840 in webkit
- Timestamp:
- Apr 21, 2013 11:36:58 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r148839 r148840 1 2013-04-12 Balazs Kelemen <kbalazs@webkit.org> 2 3 [GStreamer] Media attribute preload="none" is not honored 4 https://bugs.webkit.org/show_bug.cgi?id=114357 5 6 Reviewed by Philippe Normand. 7 8 * http/tests/media/video-preload-expected.txt: Added. 9 * http/tests/media/video-preload.html: Added. 10 1 11 2013-04-21 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r148823 r148840 1 2013-04-12 Balazs Kelemen <kbalazs@webkit.org> 2 3 [GStreamer] Media attribute preload="none" is not honored 4 https://bugs.webkit.org/show_bug.cgi?id=114357 5 6 Reviewed by Philippe Normand. 7 8 Fix the logic that prevents live streams from being buffered to not make preload="none" ignored. 9 10 Test: http/tests/media/video-preload.html 11 We need a http test because the bug does not triggered with local files. 12 13 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 14 (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): 15 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 16 (MediaPlayerPrivateGStreamer): 17 Remove m_originalPreloadWasAutoAndWasOverridden because it is not necessary and it is causing this bug. 18 Currently if the tag has preload="none" attribute we set m_preload to Auto in the constructor. After that 19 MedaPlayer calls setPreload(None), so we set m_originalPreloadWasAutoAndWasOverridden to true and later 20 reset m_preload to Auto. The error prone factor here is that the m_preload member is repeated in the 21 private class and setPreload is also used there. This seems to be necessary because we need to be able 22 to ignore preloading if this is a live stream. Fortunately the original parsed value is available in the 23 constructor, so we can use that. This will give the correct value that we should override only in the case 24 of a live stream and that's it, we don't need to reset it later to Auto. 25 Furthermore, we should ignore setting preload to auto from js if it is a live stream. This patch also handles 26 this with an early return in setPreload. 27 1 28 2013-04-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 29 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r148611 r148840 208 208 , m_maxTimeLoaded(0) 209 209 , m_bufferingPercentage(0) 210 , m_preload( MediaPlayer::Auto)210 , m_preload(player->preload()) 211 211 , m_delayingLoad(false) 212 212 , m_mediaDurationKnown(true) … … 219 219 , m_webkitAudioSink(0) 220 220 , m_totalBytes(-1) 221 , m_originalPreloadWasAutoAndWasOverridden(false)222 221 , m_preservesPitch(false) 223 222 , m_requestedState(GST_STATE_VOID_PENDING) … … 1391 1390 if (previousDuration && m_mediaDuration != previousDuration) 1392 1391 m_player->durationChanged(); 1393 1394 if (m_preload == MediaPlayer::None && m_originalPreloadWasAutoAndWasOverridden) {1395 m_totalBytes = -1;1396 if (totalBytes() && !isLiveStream()) {1397 setPreload(MediaPlayer::Auto);1398 gst_element_set_state(m_playBin.get(), GST_STATE_NULL);1399 gst_element_set_state(m_playBin.get(), GST_STATE_PAUSED);1400 }1401 }1402 1392 } 1403 1393 … … 1554 1544 void MediaPlayerPrivateGStreamer::setPreload(MediaPlayer::Preload preload) 1555 1545 { 1556 m_originalPreloadWasAutoAndWasOverridden = m_preload != preload && m_preload == MediaPlayer::Auto; 1546 if (preload == MediaPlayer::Auto && isLiveStream()) 1547 return; 1557 1548 1558 1549 m_preload = preload; -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r147279 r148840 161 161 mutable long m_totalBytes; 162 162 KURL m_url; 163 bool m_originalPreloadWasAutoAndWasOverridden;164 163 bool m_preservesPitch; 165 164 GstState m_requestedState;
Note: See TracChangeset
for help on using the changeset viewer.