summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-17 14:52:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-17 14:52:24 +0000
commitf40c03663b37d38431a99394419c512514105123 (patch)
tree9b8f3d2468fb7650eda85aab4393690f6fc66fd6
parentAdding upstream version 0.34.0. (diff)
downloadmpv-upstream.tar.xz
mpv-upstream.zip
Adding upstream version 0.34.1.upstream/0.34.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--RELEASE_NOTES26
-rw-r--r--VERSION2
-rw-r--r--audio/filter/af_lavcac3enc.c35
-rw-r--r--audio/out/ao_oss.c1
-rw-r--r--audio/out/buffer.c3
-rw-r--r--osdep/subprocess-posix.c21
-rw-r--r--video/out/opengl/context.c9
-rw-r--r--video/out/opengl/egl_helpers.c3
-rw-r--r--video/out/opengl/ra_gl.c2
-rw-r--r--video/out/wayland_common.c23
-rw-r--r--video/out/x11_common.c3
11 files changed, 92 insertions, 36 deletions
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 36e82f3..d4d6965 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -1,3 +1,23 @@
+Release 0.34.1
+==============
+
+Bug fix release for the 0.34 branch.
+
+Fixes and Minor Enhancements
+----------------------------
+
+- player: fix autofit/geometry related segfault
+- ao_oss: add missing PATH_DEV_MIXER define
+- egl_helpers: fix context creation if GLES 3 is not available
+- audio: stop corrupting audio on underreads
+- wayland: fix a potential segfault on surface enter
+- vo_gpu: opengl: fix wrong glMemoryBarrier call
+- vo_gpu: opengl: create context at version 4.4 again
+- af_lavcac3enc: fix memory leak on no-op
+- subprocess: unblock/reset signals before running child process
+- wayland: avoid doing unneccesary window resizes
+
+
Release 0.34.0
==============
@@ -140,7 +160,7 @@ This listing is not complete. Check DOCS/client-api-changes.rst for a history
of changes to the client API, and DOCS/interface-changes.rst for a history
of changes to other user-visible interfaces.
-A complete changelog can be seen by running `git log v0.33.0..v0.34.0`
+A complete changelog can be seen by running `git log v0.33.0..v0.34.1`
in the git repository or by visiting either
-https://github.com/mpv-player/mpv/compare/v0.33.0...v0.34.0 or
-https://git.srsfckn.biz/mpv/log/?qt=range&q=v0.33.0..v0.34.0
+https://github.com/mpv-player/mpv/compare/v0.33.0...v0.34.1 or
+https://git.srsfckn.biz/mpv/log/?qt=range&q=v0.33.0..v0.34.1
diff --git a/VERSION b/VERSION
index 85e60ed..cd46610 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.34.0
+0.34.1
diff --git a/audio/filter/af_lavcac3enc.c b/audio/filter/af_lavcac3enc.c
index 45e0aa6..78bfefa 100644
--- a/audio/filter/af_lavcac3enc.c
+++ b/audio/filter/af_lavcac3enc.c
@@ -163,46 +163,47 @@ static void process(struct mp_filter *f)
break;
if (lavc_ret < 0 && lavc_ret != AVERROR(EAGAIN)) {
MP_FATAL(f, "Encode failed (receive).\n");
- goto done;
+ goto error;
}
}
AVFrame *frame = NULL;
struct mp_frame input = mp_pin_out_read(s->in_pin);
// The following code assumes no sample data buffering in the encoder.
- if (input.type == MP_FRAME_EOF) {
+ switch (input.type) {
+ case MP_FRAME_NONE:
+ goto done; // no data yet
+ case MP_FRAME_EOF:
mp_pin_in_write(f->ppins[1], input);
- return;
- } else if (input.type == MP_FRAME_AUDIO) {
+ goto done;
+ case MP_FRAME_AUDIO:
TA_FREEP(&s->in_frame);
s->in_frame = input.data;
frame = mp_frame_to_av(input, NULL);
if (!frame)
- goto done;
+ goto error;
if (mp_aframe_get_channels(s->in_frame) < s->opts->min_channel_num) {
// Just pass it through.
s->in_frame = NULL;
mp_pin_in_write(f->ppins[1], input);
- return;
+ goto done;
}
if (!mp_aframe_config_equals(s->in_frame, s->cur_format)) {
if (!reinit(f))
- goto done;
+ goto error;
}
- } else if (input.type) {
- goto done;
- } else {
- return; // no data yet
+ break;
+ default: goto error; // unexpected packet type
}
int lavc_ret = avcodec_send_frame(s->lavc_actx, frame);
av_frame_free(&frame);
if (lavc_ret < 0 && lavc_ret != AVERROR(EAGAIN)) {
MP_FATAL(f, "Encode failed (send).\n");
- goto done;
+ goto error;
}
}
if (!s->in_frame)
- goto done;
+ goto error;
out = mp_aframe_create();
mp_aframe_set_format(out, AF_FORMAT_S_AC3);
@@ -210,7 +211,7 @@ static void process(struct mp_filter *f)
mp_aframe_set_rate(out, 48000);
if (mp_aframe_pool_allocate(s->out_pool, out, s->out_samples) < 0)
- goto done;
+ goto error;
int sstride = mp_aframe_get_sstride(out);
@@ -239,7 +240,7 @@ static void process(struct mp_filter *f)
uint8_t **planes = mp_aframe_get_data_rw(out);
if (!planes)
- goto done;
+ goto error;
char *buf = planes[0];
memcpy(buf, hdr, header_len);
memcpy(buf + header_len, pkt.data, pkt.size);
@@ -250,8 +251,10 @@ static void process(struct mp_filter *f)
mp_pin_in_write(f->ppins[1], MAKE_FRAME(MP_FRAME_AUDIO, out));
out = NULL;
- err = 0;
done:
+ err = false;
+ // fall through
+error:
av_packet_unref(&pkt);
talloc_free(out);
if (err)
diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c
index 11b182e..3f85774 100644
--- a/audio/out/ao_oss.c
+++ b/audio/out/ao_oss.c
@@ -49,6 +49,7 @@
#endif
#define PATH_DEV_DSP "/dev/dsp"
+#define PATH_DEV_MIXER "/dev/mixer"
struct priv {
int dsp_fd;
diff --git a/audio/out/buffer.c b/audio/out/buffer.c
index 9ac410f..2a69596 100644
--- a/audio/out/buffer.c
+++ b/audio/out/buffer.c
@@ -162,7 +162,8 @@ static int read_buffer(struct ao *ao, void **data, int samples, bool *eof)
// pad with silence (underflow/paused/eof)
for (int n = 0; n < ao->num_planes; n++) {
- af_fill_silence((char *)data[n] + pos, (samples - pos) * ao->sstride,
+ af_fill_silence((char *)data[n] + pos * ao->sstride,
+ (samples - pos) * ao->sstride,
ao->format);
}
diff --git a/osdep/subprocess-posix.c b/osdep/subprocess-posix.c
index bae0ca2..013ca14 100644
--- a/osdep/subprocess-posix.c
+++ b/osdep/subprocess-posix.c
@@ -33,6 +33,12 @@
extern char **environ;
+#ifdef SIGRTMAX
+#define SIGNAL_MAX SIGRTMAX
+#else
+#define SIGNAL_MAX 32
+#endif
+
#define SAFE_CLOSE(fd) do { if ((fd) >= 0) close((fd)); (fd) = -1; } while (0)
// Async-signal-safe execvpe(). POSIX does not list it as async-signal-safe
@@ -65,6 +71,20 @@ static int as_execvpe(const char *path, const char *file, char *const argv[],
return -1;
}
+// In the child process, resets the signal mask to defaults. Also clears any
+// signal handlers first so nothing funny happens.
+static void reset_signals_child(void)
+{
+ struct sigaction sa = { 0 };
+ sigset_t sigmask;
+ sa.sa_handler = SIG_DFL;
+ sigemptyset(&sigmask);
+
+ for (int nr = 1; nr < SIGNAL_MAX; nr++)
+ sigaction(nr, &sa, NULL);
+ sigprocmask(SIG_SETMASK, &sigmask, NULL);
+}
+
// Returns 0 on any error, valid PID on success.
// This function must be async-signal-safe, as it may be called from a fork().
static pid_t spawn_process(const char *path, struct mp_subprocess_opts *opts,
@@ -96,6 +116,7 @@ static pid_t spawn_process(const char *path, struct mp_subprocess_opts *opts,
}
if (fres == 0) {
// child
+ reset_signals_child();
for (int n = 0; n < opts->num_fds; n++) {
if (src_fds[n] == opts->fds[n].fd) {
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index 59a7eda..a946186 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -23,6 +23,15 @@
// 0-terminated list of desktop GL versions a backend should try to
// initialize. Each entry is the minimum required version.
const int mpgl_min_required_gl_versions[] = {
+ /*
+ * Nvidia drivers will not provide the highest supported version
+ * when 320 core is requested. Instead, it just returns 3.2. This
+ * would be bad, as we actually want compute shaders that require
+ * 4.2, so we have to request a sufficiently high version. We use
+ * 440 to maximise driver compatibility as we don't need anything
+ * from newer versions.
+ */
+ 440,
320,
210,
0
diff --git a/video/out/opengl/egl_helpers.c b/video/out/opengl/egl_helpers.c
index 0766be3..a81f9f4 100644
--- a/video/out/opengl/egl_helpers.c
+++ b/video/out/opengl/egl_helpers.c
@@ -41,7 +41,6 @@
#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
-#define EGL_OPENGL_ES3_BIT 0x00000040
typedef intptr_t EGLAttrib;
#endif
@@ -117,7 +116,7 @@ static bool create_context(struct ra_ctx *ctx, EGLDisplay display,
name = "Desktop OpenGL";
} else {
api = EGL_OPENGL_ES_API;
- rend = EGL_OPENGL_ES2_BIT | EGL_OPENGL_ES3_BIT;
+ rend = EGL_OPENGL_ES2_BIT;
name = "GLES 2.x +";
}
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c
index b7deba9..b0c5b34 100644
--- a/video/out/opengl/ra_gl.c
+++ b/video/out/opengl/ra_gl.c
@@ -989,7 +989,7 @@ static void update_uniform(struct ra *ra, struct ra_renderpass *pass,
gl->BindBufferBase(buf_gl->target, input->binding, buf_gl->buffer);
// SSBOs are not implicitly coherent in OpengL
if (input->type == RA_VARTYPE_BUF_RW)
- gl->MemoryBarrier(buf_gl->target);
+ gl->MemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT);
break;
}
default:
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 6810069..3cebab9 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -653,9 +653,6 @@ static void output_handle_done(void* data, struct wl_output *wl_output)
}
spawn_cursor(wl);
set_geometry(wl);
- wl->window_size = wl->vdparams;
- if (!wl->vo_opts->fullscreen && !wl->vo_opts->window_maximized)
- wl->geometry = wl->window_size;
wl->pending_vo_events |= VO_EVENT_DPI;
wl->pending_vo_events |= VO_EVENT_RESIZE;
}
@@ -685,6 +682,9 @@ static void surface_handle_enter(void *data, struct wl_surface *wl_surface,
struct wl_output *output)
{
struct vo_wayland_state *wl = data;
+ if (!wl->current_output)
+ return;
+
struct mp_rect old_output_geometry = wl->current_output->geometry;
struct mp_rect old_geometry = wl->geometry;
wl->current_output = NULL;
@@ -713,13 +713,9 @@ static void surface_handle_enter(void *data, struct wl_surface *wl_surface,
if (!mp_rect_equals(&old_output_geometry, &wl->current_output->geometry)) {
set_geometry(wl);
- wl->window_size = wl->vdparams;
force_resize = true;
}
- if (!wl->vo_opts->fullscreen && !wl->vo_opts->window_maximized)
- wl->geometry = wl->window_size;
-
if (!mp_rect_equals(&old_geometry, &wl->geometry) || force_resize)
wl->pending_vo_events |= VO_EVENT_RESIZE;
@@ -1370,6 +1366,7 @@ static int set_cursor_visibility(struct vo_wayland_state *wl, bool on)
static void set_geometry(struct vo_wayland_state *wl)
{
struct vo *vo = wl->vo;
+ assert(wl->current_output);
struct vo_win_geometry geo;
struct mp_rect screenrc = wl->current_output->geometry;
@@ -1597,11 +1594,13 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg)
if (opt == &opts->geometry || opt == &opts->autofit ||
opt == &opts->autofit_smaller || opt == &opts->autofit_larger)
{
- set_geometry(wl);
- wl->window_size = wl->vdparams;
- if (!wl->vo_opts->fullscreen && !wl->vo_opts->window_maximized)
- wl->geometry = wl->window_size;
- wl->pending_vo_events |= VO_EVENT_RESIZE;
+ if (wl->current_output) {
+ set_geometry(wl);
+ wl->window_size = wl->vdparams;
+ if (!wl->vo_opts->fullscreen && !wl->vo_opts->window_maximized)
+ wl->geometry = wl->window_size;
+ wl->pending_vo_events |= VO_EVENT_RESIZE;
+ }
}
}
return VO_TRUE;
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 2e685e2..fe27483 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1847,6 +1847,9 @@ static void vo_x11_set_geometry(struct vo *vo)
{
struct vo_x11_state *x11 = vo->x11;
+ if (!x11->window)
+ return;
+
if (x11->opts->window_maximized) {
x11->pending_geometry_change = true;
} else {