chromium/chromium-57.0.2987.110-enable-mp3.patch
2017-03-26 11:15:12 -04:00

129 lines
8.8 KiB
Diff

diff -up chromium-57.0.2987.110/third_party/ffmpeg/ffmpeg_generated.gni.mp3 chromium-57.0.2987.110/third_party/ffmpeg/ffmpeg_generated.gni
--- chromium-57.0.2987.110/third_party/ffmpeg/ffmpeg_generated.gni.mp3 2017-03-20 13:53:24.000000000 -0400
+++ chromium-57.0.2987.110/third_party/ffmpeg/ffmpeg_generated.gni 2017-03-20 13:59:11.214419428 -0400
@@ -176,19 +176,12 @@ if ((is_linux && current_cpu == "arm" &&
]
}
-if ((current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mips64el" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_win && ffmpeg_branding == "Chrome")) {
+if ((current_cpu == "x64") || (is_android && current_cpu == "arm" && arm_use_neon) || (is_android && current_cpu == "arm64") || (is_android && current_cpu == "mips64el") || (is_android && current_cpu == "mipsel") || (is_android && current_cpu == "x86") || (is_linux && current_cpu == "arm" && arm_use_neon) || (is_linux && current_cpu == "arm" && arm_use_neon) || (is_linux && current_cpu == "arm") || (is_linux && current_cpu == "arm64") || (is_linux && current_cpu == "mipsel") || (is_linux && current_cpu == "x64") || (is_linux && current_cpu == "x86") || (is_win))
+{
ffmpeg_c_sources += [
- "libavcodec/aac_ac3_parser.c",
- "libavcodec/aac_parser.c",
- "libavcodec/aacadtsdec.c",
- "libavcodec/aacps_float.c",
- "libavcodec/aacpsdsp_float.c",
- "libavcodec/aacsbr.c",
- "libavcodec/aactab.c",
- "libavcodec/ac3tab.c",
- "libavcodec/autorename_libavcodec_aacdec.c",
"libavcodec/autorename_libavcodec_mpegaudiodsp.c",
"libavcodec/autorename_libavcodec_sbrdsp.c",
+ "libavcodec/ac3tab.c",
"libavcodec/cbrt_data.c",
"libavcodec/dct.c",
"libavcodec/dct32_fixed.c",
@@ -204,7 +197,6 @@ if ((current_cpu == "x64" && ffmpeg_bran
"libavcodec/mpegaudiodsp_float.c",
"libavcodec/sinewin.c",
"libavcodec/sinewin_fixed.c",
- "libavformat/aacdec.c",
"libavformat/apetag.c",
"libavformat/img2.c",
"libavformat/mov.c",
@@ -213,6 +205,21 @@ if ((current_cpu == "x64" && ffmpeg_bran
]
}
+if ((current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mips64el" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_win && ffmpeg_branding == "Chrome"))
+{
+ ffmpeg_c_sources += [
+ "libavcodec/aac_ac3_parser.c",
+ "libavcodec/aac_parser.c",
+ "libavcodec/aacadtsdec.c",
+ "libavcodec/aacps_float.c",
+ "libavcodec/aacpsdsp_float.c",
+ "libavcodec/aacsbr.c",
+ "libavcodec/aactab.c",
+ "libavcodec/autorename_libavcodec_aacdec.c",
+ "libavformat/aacdec.c",
+ ]
+}
+
if ((is_android && current_cpu == "x64") || (is_android && current_cpu == "x86") || (is_linux && current_cpu == "x64") || (is_linux && current_cpu == "x86") || (is_mac) || (is_win)) {
ffmpeg_c_sources += [
"libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c",
@@ -312,21 +319,31 @@ if ((is_linux && current_cpu == "x64") |
if ((current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_win && ffmpeg_branding == "Chrome")) {
ffmpeg_c_sources += [
"libavcodec/x86/aacpsdsp_init.c",
+ ]
+}
+
+if ((current_cpu == "x64") || (is_android && current_cpu == "x86") || (is_linux && current_cpu == "x64") || (is_linux && current_cpu == "x86") || (is_win)) {
+ ffmpeg_c_sources += [
"libavcodec/x86/dct_init.c",
"libavcodec/x86/mpegaudiodsp.c",
"libavcodec/x86/sbrdsp_init.c",
]
}
-if ((current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_win && ffmpeg_branding == "Chrome")) {
+if ((current_cpu == "x64") || (is_android && current_cpu == "x86") || (is_linux && current_cpu == "x64") || (is_linux && current_cpu == "x86") || (is_win)) {
ffmpeg_yasm_sources += [
- "libavcodec/x86/aacpsdsp.asm",
"libavcodec/x86/dct32.asm",
"libavcodec/x86/imdct36.asm",
"libavcodec/x86/sbrdsp.asm",
]
}
+if ((current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_win && ffmpeg_branding == "Chrome")) {
+ ffmpeg_yasm_sources += [
+ "libavcodec/x86/aacpsdsp.asm",
+ ]
+}
+
if ((is_linux && current_cpu == "arm" && arm_use_neon) || (is_linux && current_cpu == "arm")) {
ffmpeg_c_sources += [
"libavcodec/arm/h264pred_init_arm.c",
diff -up chromium-57.0.2987.110/third_party/ffmpeg/libavcodec/sbrdsp.c.mp3 chromium-57.0.2987.110/third_party/ffmpeg/libavcodec/sbrdsp.c
--- chromium-57.0.2987.110/third_party/ffmpeg/libavcodec/sbrdsp.c.mp3 2017-03-20 14:15:22.068309439 -0400
+++ chromium-57.0.2987.110/third_party/ffmpeg/libavcodec/sbrdsp.c 2017-03-20 14:15:47.826802603 -0400
@@ -23,6 +23,7 @@
#define USE_FIXED 0
#include "aac.h"
+#include "aacsbrdata.h"
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/intfloat.h"
diff -up chromium-57.0.2987.110/media/base/mime_util_internal.cc.mp3 chromium-57.0.2987.110/media/base/mime_util_internal.cc
--- chromium-57.0.2987.110/media/base/mime_util_internal.cc.mp3 2017-03-26 11:11:41.480377812 -0400
+++ chromium-57.0.2987.110/media/base/mime_util_internal.cc 2017-03-26 11:13:19.289810708 -0400
@@ -291,10 +291,10 @@ void MimeUtil::AddSupportedMediaFormats(
CodecSet webm_codecs(webm_audio_codecs);
webm_codecs.insert(webm_video_codecs.begin(), webm_video_codecs.end());
-#if defined(USE_PROPRIETARY_CODECS)
CodecSet mp3_codecs;
mp3_codecs.insert(MP3);
+#if defined(USE_PROPRIETARY_CODECS)
CodecSet aac;
aac.insert(MPEG2_AAC);
aac.insert(MPEG4_AAC);
@@ -335,10 +335,10 @@ void MimeUtil::AddSupportedMediaFormats(
AddContainerWithCodecs("application/ogg", ogg_codecs, false);
AddContainerWithCodecs("audio/flac", implicit_codec, false);
-#if defined(USE_PROPRIETARY_CODECS)
AddContainerWithCodecs("audio/mpeg", mp3_codecs, true); // Allow "mp3".
AddContainerWithCodecs("audio/mp3", implicit_codec, true);
AddContainerWithCodecs("audio/x-mp3", implicit_codec, true);
+#if defined(USE_PROPRIETARY_CODECS)
AddContainerWithCodecs("audio/aac", implicit_codec, true); // AAC / ADTS.
AddContainerWithCodecs("audio/mp4", mp4_audio_codecs, true);
DCHECK(!mp4_video_codecs.empty());