Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1150 return false; | 1150 return false; |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 TRACE_EVENT_ASYNC_END0("media", "SourceBuffer::prepareAppend", this); | 1153 TRACE_EVENT_ASYNC_END0("media", "SourceBuffer::prepareAppend", this); |
| 1154 return true; | 1154 return true; |
| 1155 } | 1155 } |
| 1156 | 1156 |
| 1157 bool SourceBuffer::evictCodedFrames(size_t newDataSize) { | 1157 bool SourceBuffer::evictCodedFrames(size_t newDataSize) { |
| 1158 DCHECK(m_source); | 1158 DCHECK(m_source); |
| 1159 DCHECK(m_source->mediaElement()); | 1159 DCHECK(m_source->mediaElement()); |
| 1160 | |
| 1161 // Nothing to do if the mediaElement does not yet have frames to evict. | |
| 1162 // mediaElement()->currentTime() will be NaN. | |
| 1163 if (m_source->mediaElement()->getReadyState() < | |
| 1164 HTMLMediaElement::kHaveMetadata) | |
| 1165 return true; | |
|
mlamouri (slow - plz ping)
2016/10/26 15:32:54
style: wrap in { }
Would it make sense to check f
chcunningham
2016/10/26 19:29:41
Done.
| |
| 1166 | |
| 1160 double currentTime = m_source->mediaElement()->currentTime(); | 1167 double currentTime = m_source->mediaElement()->currentTime(); |
| 1161 bool result = m_webSourceBuffer->evictCodedFrames(currentTime, newDataSize); | 1168 bool result = m_webSourceBuffer->evictCodedFrames(currentTime, newDataSize); |
| 1162 if (!result) { | 1169 if (!result) { |
| 1163 BLINK_SBLOG << __func__ << " this=" << this | 1170 BLINK_SBLOG << __func__ << " this=" << this |
| 1164 << " failed. newDataSize=" << newDataSize | 1171 << " failed. newDataSize=" << newDataSize |
| 1165 << " currentTime=" << currentTime << " buffered=" | 1172 << " currentTime=" << currentTime << " buffered=" |
| 1166 << webTimeRangesToString(m_webSourceBuffer->buffered()); | 1173 << webTimeRangesToString(m_webSourceBuffer->buffered()); |
| 1167 } | 1174 } |
| 1168 return result; | 1175 return result; |
| 1169 } | 1176 } |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1486 visitor->trace(m_removeAsyncPartRunner); | 1493 visitor->trace(m_removeAsyncPartRunner); |
| 1487 visitor->trace(m_appendStreamAsyncPartRunner); | 1494 visitor->trace(m_appendStreamAsyncPartRunner); |
| 1488 visitor->trace(m_stream); | 1495 visitor->trace(m_stream); |
| 1489 visitor->trace(m_audioTracks); | 1496 visitor->trace(m_audioTracks); |
| 1490 visitor->trace(m_videoTracks); | 1497 visitor->trace(m_videoTracks); |
| 1491 EventTargetWithInlineData::trace(visitor); | 1498 EventTargetWithInlineData::trace(visitor); |
| 1492 ActiveDOMObject::trace(visitor); | 1499 ActiveDOMObject::trace(visitor); |
| 1493 } | 1500 } |
| 1494 | 1501 |
| 1495 } // namespace blink | 1502 } // namespace blink |
| OLD | NEW |