summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-03-19 12:02:19 -0400
committerKacper Michajłow <kasper93@gmail.com>2024-03-19 19:30:27 +0100
commit5fea0f9a475fc6ce9bfb4ca18da489c881313ce8 (patch)
treea4965994350ee8001f26e9ad148c941bcb8c5128
parentdf01ebaafcd93fdc7d48e4e8292daf5f1e932f16 (diff)
downloadmpv-5fea0f9a475fc6ce9bfb4ca18da489c881313ce8.tar.bz2
mpv-5fea0f9a475fc6ce9bfb4ca18da489c881313ce8.tar.xz
various: use thread safe mp_strerror()
-rw-r--r--audio/out/ao_oss.c5
-rw-r--r--audio/out/ao_pipewire.c5
-rw-r--r--video/out/drm_common.c2
-rw-r--r--video/out/vulkan/context_display.c3
4 files changed, 9 insertions, 6 deletions
diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c
index 5c0b8c97aa..afe5839dd5 100644
--- a/audio/out/ao_oss.c
+++ b/audio/out/ao_oss.c
@@ -36,6 +36,7 @@
#include <sys/types.h>
#include "audio/format.h"
+#include "common/common.h"
#include "common/msg.h"
#include "options/options.h"
#include "osdep/endian.h"
@@ -89,7 +90,7 @@ static const int format_table[][2] = {
#define MP_WARN_IOCTL_ERR(__ao) \
MP_WARN((__ao), "%s: ioctl() fail, err = %i: %s\n", \
- __FUNCTION__, errno, strerror(errno))
+ __FUNCTION__, errno, mp_strerror(errno))
static void uninit(struct ao *ao);
@@ -329,7 +330,7 @@ static bool audio_write(struct ao *ao, void **data, int samples)
if (errno == EINTR)
continue;
MP_WARN(ao, "audio_write: write() fail, err = %i: %s.\n",
- errno, strerror(errno));
+ errno, mp_strerror(errno));
return false;
}
if ((size_t)rc != size) {
diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c
index 2fe47ec46e..c7d7ca6cb6 100644
--- a/audio/out/ao_pipewire.c
+++ b/audio/out/ao_pipewire.c
@@ -27,6 +27,7 @@
#include <spa/utils/result.h>
#include <math.h>
+#include "common/common.h"
#include "common/msg.h"
#include "options/m_config.h"
#include "options/m_option.h"
@@ -166,7 +167,7 @@ static void on_process(void *userdata)
void *data[MP_NUM_CHANNELS];
if ((b = pw_stream_dequeue_buffer(p->stream)) == NULL) {
- MP_WARN(ao, "out of buffers: %s\n", strerror(errno));
+ MP_WARN(ao, "out of buffers: %s\n", mp_strerror(errno));
return;
}
@@ -518,7 +519,7 @@ static int pipewire_init_boilerplate(struct ao *ao)
if (!p->core) {
MP_MSG(ao, ao->probing ? MSGL_V : MSGL_ERR,
"Could not connect to context '%s': %s\n",
- p->options.remote, strerror(errno));
+ p->options.remote, mp_strerror(errno));
pw_context_destroy(context);
goto error;
}
diff --git a/video/out/drm_common.c b/video/out/drm_common.c
index cc1df9442b..e47de7df86 100644
--- a/video/out/drm_common.c
+++ b/video/out/drm_common.c
@@ -388,7 +388,7 @@ bool vo_drm_acquire_crtc(struct vo_drm_state *drm)
drm_object_set_property(request, atomic_ctx->draw_plane, "CRTC_H", drm->mode.mode.vdisplay);
if (drmModeAtomicCommit(drm->fd, request, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL)) {
- MP_ERR(drm, "Failed to commit ModeSetting atomic request: %s\n", strerror(errno));
+ MP_ERR(drm, "Failed to commit ModeSetting atomic request: %s\n", mp_strerror(errno));
goto err;
}
diff --git a/video/out/vulkan/context_display.c b/video/out/vulkan/context_display.c
index 84cef1e8c2..fd2baf0a44 100644
--- a/video/out/vulkan/context_display.c
+++ b/video/out/vulkan/context_display.c
@@ -15,6 +15,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "common/common.h"
#include "context.h"
#include "options/m_config.h"
#include "utils.h"
@@ -296,7 +297,7 @@ static void open_render_fd(struct ra_ctx *ctx, const char *render_path)
p->drm_params.render_fd = open(render_path, O_RDWR | O_CLOEXEC);
if (p->drm_params.render_fd == -1) {
MP_WARN(ctx, "Failed to open render node: %s\n",
- strerror(errno));
+ mp_strerror(errno));
}
}