mirror of https://github.com/mpv-player/mpv
client API: remove SIGPIPE overriding code
This workaround prevented that libmpv users could accidentally crash when the SIGPIPE signal was triggered by FFmpeg's OpenSSL/GnuTLS usage. But it also modifies the global signal handler state, so remove it now that this workaround is not required anymore.
This commit is contained in:
parent
f143665864
commit
1b5b23b948
|
@ -37,6 +37,8 @@ API changes
|
||||||
instead of "no-video=" you should set "video=no".
|
instead of "no-video=" you should set "video=no".
|
||||||
- be much more permissive what API calls are allowed before
|
- be much more permissive what API calls are allowed before
|
||||||
mpv_initialize().
|
mpv_initialize().
|
||||||
|
- do not override the SIGPIPE signal handler anymore. This was done as
|
||||||
|
workaround for the FFmpeg TLS code, which has been fixed long ago.
|
||||||
--- mpv 0.19.0 ---
|
--- mpv 0.19.0 ---
|
||||||
1.22 - add stream_cb API for custom protocols
|
1.22 - add stream_cb API for custom protocols
|
||||||
--- mpv 0.18.1 ---
|
--- mpv 0.18.1 ---
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -97,6 +98,11 @@ static void *client_thread(void *p)
|
||||||
{
|
{
|
||||||
pthread_detach(pthread_self());
|
pthread_detach(pthread_self());
|
||||||
|
|
||||||
|
// We don't use MSG_NOSIGNAL because the moldy fruit OS doesn't support it.
|
||||||
|
struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = SA_RESTART };
|
||||||
|
sigfillset(&sa.sa_mask);
|
||||||
|
sigaction(SIGPIPE, &sa, NULL);
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
struct client_arg *arg = p;
|
struct client_arg *arg = p;
|
||||||
|
|
|
@ -135,10 +135,6 @@ extern "C" {
|
||||||
* (used through libass), ALSA, FFmpeg, and possibly more.
|
* (used through libass), ALSA, FFmpeg, and possibly more.
|
||||||
* - The FPU precision must be set at least to double precision.
|
* - The FPU precision must be set at least to double precision.
|
||||||
* - On Windows, mpv will call timeBeginPeriod(1).
|
* - On Windows, mpv will call timeBeginPeriod(1).
|
||||||
* - On UNIX, every mpv_initialize() call will block SIGPIPE. This is done
|
|
||||||
* because FFmpeg makes unsafe use of OpenSSL and GnuTLS, which can raise
|
|
||||||
* this signal under certain circumstances. Once these libraries (or FFmpeg)
|
|
||||||
* are fixed, libmpv will not block the signal anymore.
|
|
||||||
* - On memory exhaustion, mpv will kill the process.
|
* - On memory exhaustion, mpv will kill the process.
|
||||||
*
|
*
|
||||||
* Encoding of filenames
|
* Encoding of filenames
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <signal.h>
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "mpv_talloc.h"
|
#include "mpv_talloc.h"
|
||||||
|
@ -514,12 +513,6 @@ int mp_initialize(struct MPContext *mpctx, char **options)
|
||||||
if (opts->w32_priority > 0)
|
if (opts->w32_priority > 0)
|
||||||
SetPriorityClass(GetCurrentProcess(), opts->w32_priority);
|
SetPriorityClass(GetCurrentProcess(), opts->w32_priority);
|
||||||
#endif
|
#endif
|
||||||
#ifndef _WIN32
|
|
||||||
// Deal with OpenSSL and GnuTLS not using MSG_NOSIGNAL.
|
|
||||||
struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = SA_RESTART };
|
|
||||||
sigfillset(&sa.sa_mask);
|
|
||||||
sigaction(SIGPIPE, &sa, NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
prepare_playlist(mpctx, mpctx->playlist);
|
prepare_playlist(mpctx, mpctx->playlist);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue