media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 7f4c7ff6b0f0e74338c885b0d5e5ef80fed597c3 Mon Sep 17 00:00:00 2001
  2. From: Dan Sanders <sandersd@chromium.org>
  3. Date: Tue, 11 Aug 2020 20:38:03 +0000
  4. Subject: [PATCH] [media] Set allocation limit compatible with FFmpeg 4.3
  5. Previously we set the limit to zero, meaning no limit, but FFmpeg 4.3
  6. will not allocate at all with that setting.
  7. Changed to std::numeric_limits<size_t>::max().
  8. Bug: 1095962
  9. Change-Id: I96820c21f794f2814e955ee75ff22dfd31804c29
  10. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2349405
  11. Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
  12. Commit-Queue: Dan Sanders <sandersd@chromium.org>
  13. Cr-Commit-Position: refs/heads/master@{#796966}
  14. ---
  15. media/base/media.cc | 5 ++++-
  16. 1 file changed, 4 insertions(+), 1 deletion(-)
  17. diff --git a/media/base/media.cc b/media/base/media.cc
  18. index c282ee49a03..11e99c238ba 100644
  19. --- a/media/base/media.cc
  20. +++ b/media/base/media.cc
  21. @@ -4,6 +4,9 @@
  22. #include "media/base/media.h"
  23. +#include <stdint.h>
  24. +#include <limits>
  25. +
  26. #include "base/allocator/buildflags.h"
  27. #include "base/command_line.h"
  28. #include "base/macros.h"
  29. @@ -41,7 +44,7 @@ class MediaInitializer {
  30. #if BUILDFLAG(USE_ALLOCATOR_SHIM)
  31. // Remove allocation limit from ffmpeg, so calls go down to shim layer.
  32. - av_max_alloc(0);
  33. + av_max_alloc(std::numeric_limits<size_t>::max());
  34. #endif // BUILDFLAG(USE_ALLOCATOR_SHIM)
  35. #endif // BUILDFLAG(ENABLE_FFMPEG)