summaryrefslogtreecommitdiff
path: root/chromium/third_party/ffmpeg/libswresample
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-11-28 16:14:41 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-12-13 15:19:41 +0000
commit61d9742824d54be5693191fe502325a909feca59 (patch)
treecbf28e779b11338fe52eb75b915684cd8955542c /chromium/third_party/ffmpeg/libswresample
parent45f9ded08bb7526984b24ccb5a5327aaf6821676 (diff)
downloadqtwebengine-chromium-61d9742824d54be5693191fe502325a909feca59.tar.gz
BASELINE: Update Chromium to 108.0.5359.70
Change-Id: I77334ff232b819600f275bd3cfe41fbaa3619230 Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/445904 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/ffmpeg/libswresample')
-rw-r--r--chromium/third_party/ffmpeg/libswresample/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libswresample/swresample.c54
-rw-r--r--chromium/third_party/ffmpeg/libswresample/swresample.h4
-rw-r--r--chromium/third_party/ffmpeg/libswresample/version.h2
4 files changed, 39 insertions, 23 deletions
diff --git a/chromium/third_party/ffmpeg/libswresample/Makefile b/chromium/third_party/ffmpeg/libswresample/Makefile
index dc80027c358..8b9a0fe6f55 100644
--- a/chromium/third_party/ffmpeg/libswresample/Makefile
+++ b/chromium/third_party/ffmpeg/libswresample/Makefile
@@ -22,6 +22,6 @@ OBJS-$(CONFIG_LIBSOXR) += soxr_resample.o
SHLIBOBJS += log2_tab.o
# Windows resource file
-SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o
+SHLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o
TESTPROGS = swresample
diff --git a/chromium/third_party/ffmpeg/libswresample/swresample.c b/chromium/third_party/ffmpeg/libswresample/swresample.c
index 9b77ef65bfb..5884f8d5330 100644
--- a/chromium/third_party/ffmpeg/libswresample/swresample.c
+++ b/chromium/third_party/ffmpeg/libswresample/swresample.c
@@ -83,8 +83,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
#endif
int swr_alloc_set_opts2(struct SwrContext **ps,
- AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
- AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
+ const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
+ const AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
int log_offset, void *log_ctx) {
struct SwrContext *s = *ps;
int ret;
@@ -227,7 +227,7 @@ av_cold int swr_init(struct SwrContext *s){
s->in_ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
s->in_ch_layout.nb_channels = s->user_in_ch_count;
}
- } else
+ } else if (av_channel_layout_check(&s->user_in_chlayout))
av_channel_layout_copy(&s->in_ch_layout, &s->user_in_chlayout);
if ((s->user_out_ch_count && s->user_out_ch_count != s->user_out_chlayout.nb_channels) ||
@@ -240,17 +240,45 @@ av_cold int swr_init(struct SwrContext *s){
s->out_ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
s->out_ch_layout.nb_channels = s->user_out_ch_count;
}
- } else
+ } else if (av_channel_layout_check(&s->user_out_chlayout))
av_channel_layout_copy(&s->out_ch_layout, &s->user_out_chlayout);
if (!s->out.ch_count && !s->user_out_ch_layout)
s->out.ch_count = s->out_ch_layout.nb_channels;
if (!s-> in.ch_count && !s-> user_in_ch_layout)
s-> in.ch_count = s->in_ch_layout.nb_channels;
+
+ if (!(ret = av_channel_layout_check(&s->in_ch_layout)) || s->in_ch_layout.nb_channels > SWR_CH_MAX) {
+ if (ret)
+ av_channel_layout_describe(&s->in_ch_layout, l1, sizeof(l1));
+ av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or unsupported.\n", ret ? l1 : "");
+ return AVERROR(EINVAL);
+ }
+
+ if (!(ret = av_channel_layout_check(&s->out_ch_layout)) || s->out_ch_layout.nb_channels > SWR_CH_MAX) {
+ if (ret)
+ av_channel_layout_describe(&s->out_ch_layout, l2, sizeof(l2));
+ av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or unsupported.\n", ret ? l2 : "");
+ return AVERROR(EINVAL);
+ }
#else
s->out.ch_count = s-> user_out_chlayout.nb_channels;
s-> in.ch_count = s-> user_in_chlayout.nb_channels;
+ if (!(ret = av_channel_layout_check(&s->user_in_chlayout)) || s->user_in_chlayout.nb_channels > SWR_CH_MAX) {
+ if (ret)
+ av_channel_layout_describe(&s->user_in_chlayout, l1, sizeof(l1));
+ av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or unsupported.\n", ret ? l1 : "");
+ return AVERROR(EINVAL);
+ }
+
+ if (!(ret = av_channel_layout_check(&s->user_out_chlayout)) || s->user_out_chlayout.nb_channels > SWR_CH_MAX) {
+ if (ret)
+ av_channel_layout_describe(&s->user_out_chlayout, l2, sizeof(l2));
+ av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or unsupported.\n", ret ? l2 : "");
+ return AVERROR(EINVAL);
+ }
+
ret = av_channel_layout_copy(&s->in_ch_layout, &s->user_in_chlayout);
ret |= av_channel_layout_copy(&s->out_ch_layout, &s->user_out_chlayout);
if (ret < 0)
@@ -261,18 +289,6 @@ av_cold int swr_init(struct SwrContext *s){
s->dither.method = s->user_dither_method;
- if (!av_channel_layout_check(&s->in_ch_layout) || s->in_ch_layout.nb_channels > SWR_CH_MAX) {
- av_channel_layout_describe(&s->in_ch_layout, l1, sizeof(l1));
- av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or unsupported.\n", l1);
- av_channel_layout_uninit(&s->in_ch_layout);
- }
-
- if (!av_channel_layout_check(&s->out_ch_layout) || s->out_ch_layout.nb_channels > SWR_CH_MAX) {
- av_channel_layout_describe(&s->out_ch_layout, l2, sizeof(l2));
- av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or unsupported.\n", l2);
- av_channel_layout_uninit(&s->out_ch_layout);
- }
-
switch(s->engine){
#if CONFIG_LIBSOXR
case SWR_ENGINE_SOXR: s->resampler = &swri_soxr_resampler; break;
@@ -291,9 +307,9 @@ av_cold int swr_init(struct SwrContext *s){
av_channel_layout_uninit(&s->in_ch_layout);
}
- if (!s->in_ch_layout.nb_channels || s->in_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
+ if (s->in_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
av_channel_layout_default(&s->in_ch_layout, s->used_ch_count);
- if (!s->out_ch_layout.nb_channels || s->out_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
+ if (s->out_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
av_channel_layout_default(&s->out_ch_layout, s->out.ch_count);
s->rematrix = av_channel_layout_compare(&s->out_ch_layout, &s->in_ch_layout) ||
@@ -385,8 +401,8 @@ av_cold int swr_init(struct SwrContext *s){
goto fail;
}
+ av_channel_layout_describe(&s->out_ch_layout, l2, sizeof(l2));
#if FF_API_OLD_CHANNEL_LAYOUT
- av_channel_layout_describe(&s->out_ch_layout, l1, sizeof(l1));
if (s->out_ch_layout.order != AV_CHANNEL_ORDER_UNSPEC && s->out.ch_count != s->out_ch_layout.nb_channels) {
av_log(s, AV_LOG_ERROR, "Output channel layout %s mismatches specified channel count %d\n", l2, s->out.ch_count);
ret = AVERROR(EINVAL);
diff --git a/chromium/third_party/ffmpeg/libswresample/swresample.h b/chromium/third_party/ffmpeg/libswresample/swresample.h
index 26d42fab8d7..980be657831 100644
--- a/chromium/third_party/ffmpeg/libswresample/swresample.h
+++ b/chromium/third_party/ffmpeg/libswresample/swresample.h
@@ -286,8 +286,8 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
* On error, the Swr context is freed and *ps set to NULL.
*/
int swr_alloc_set_opts2(struct SwrContext **ps,
- AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
- AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
+ const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
+ const AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
int log_offset, void *log_ctx);
/**
* @}
diff --git a/chromium/third_party/ffmpeg/libswresample/version.h b/chromium/third_party/ffmpeg/libswresample/version.h
index 66bac2fa9bd..4b9952d9148 100644
--- a/chromium/third_party/ffmpeg/libswresample/version.h
+++ b/chromium/third_party/ffmpeg/libswresample/version.h
@@ -30,7 +30,7 @@
#include "version_major.h"
-#define LIBSWRESAMPLE_VERSION_MINOR 8
+#define LIBSWRESAMPLE_VERSION_MINOR 9
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \