summaryrefslogtreecommitdiffstats
path: root/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch
blob: d9319a36038614ae7b1d8a46b455043359aff758 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 7f4c7ff6b0f0e74338c885b0d5e5ef80fed597c3 Mon Sep 17 00:00:00 2001
From: Dan Sanders <sandersd@chromium.org>
Date: Tue, 11 Aug 2020 20:38:03 +0000
Subject: [PATCH] [media] Set allocation limit compatible with FFmpeg 4.3

Previously we set the limit to zero, meaning no limit, but FFmpeg 4.3
will not allocate at all with that setting.

Changed to std::numeric_limits<size_t>::max().

Bug: 1095962
Change-Id: I96820c21f794f2814e955ee75ff22dfd31804c29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2349405
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Dan Sanders <sandersd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796966}
---
 media/base/media.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/media/base/media.cc b/media/base/media.cc
index c282ee49a03..11e99c238ba 100644
--- a/media/base/media.cc
+++ b/media/base/media.cc
@@ -4,6 +4,9 @@
 
 #include "media/base/media.h"
 
+#include <stdint.h>
+#include <limits>
+
 #include "base/allocator/buildflags.h"
 #include "base/command_line.h"
 #include "base/macros.h"
@@ -41,7 +44,7 @@ class MediaInitializer {
 
 #if BUILDFLAG(USE_ALLOCATOR_SHIM)
     // Remove allocation limit from ffmpeg, so calls go down to shim layer.
-    av_max_alloc(0);
+    av_max_alloc(std::numeric_limits<size_t>::max());
 #endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // BUILDFLAG(ENABLE_FFMPEG)