Skip to content

Commit 17a2feb

Browse files
asurdej-comcastvivienne-w
authored andcommitted
[WPE][MSE][GStreamer] Fix QuotaExceededError for init segment when no text limit specified
https://bugs.webkit.org/show_bug.cgi?id=302072 Reviewed by Philippe Normand and Alicia Boya Garcia. Ignore missing "Text" limit in MSE_MAX_BUFFER_SIZE env when calculating max buffer size for init segment. With current impl, missing any of track type A/V/T from MSE_MAX_BUFFER_SIZE causes WebKit to fallback to default value from HTMLMediaElement/settings that is ~15MB for WPE. Providing higher video and audio limits in the env we can still end up in QuotaExceededError because of that. Assume video and audio limits are enough to calculate accumulative max buffer size for any type of track. Original author: Andrzej Surdej <Andrzej_Surdej@comcast.com> See: #1578 * Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::platformMaximumBufferSize const): Canonical link: https://commits.webkit.org/302839@main
1 parent 692a0e6 commit 17a2feb

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,12 @@ size_t SourceBufferPrivateGStreamer::platformMaximumBufferSize() const
338338
}
339339
});
340340

341-
// If any track type size isn't specified, we consider that it has no limit and the values from the
342-
// element have to be used. Otherwise, the track limits are accumulative. If everything is specified
343-
// but there's no track (eg: because we're processing an init segment that we don't know yet which
344-
// kind of track(s) is going to generate) we assume that the 3 kind of tracks might appear (audio,
345-
// video, text) and use all the accumulated limits at once to make room for any possible outcome.
341+
// If either audio or video track type size isn't specified, we consider that it has no limit
342+
// and the values from the element have to be used. Otherwise, the track limits are accumulative.
343+
// If at least video and audio are specified but there's no track (eg: because we're processing
344+
// an init segment that we don't know yet which kind of track(s) is going to generate) we assume
345+
// that the 3 kind of tracks might appear (audio, video, text) and use all the accumulated
346+
// limits at once to make room for any possible outcome.
346347
do {
347348
bool hasVideo = false;
348349
bool hasAudio = false;
@@ -380,7 +381,7 @@ size_t SourceBufferPrivateGStreamer::platformMaximumBufferSize() const
380381
if (hasText || m_tracks.empty()) {
381382
if (maxBufferSizeText)
382383
bufferSize += maxBufferSizeText;
383-
else
384+
else if (hasText)
384385
break;
385386
}
386387
if (bufferSize)

0 commit comments

Comments
 (0)