mirror of
https://github.com/mpv-player/mpv
synced 2025-02-01 20:52:05 +00:00
build: simplify OSS checks and remove changes by "bugmen0t"
The user bugmen0t was apparently a shared github account with publicly available login. Thus, we can't get LGPL relicensing permission from the people who used this account. To relicense successfully, we have to remove all their changes. This commit should remove20d1fc13
,f26fb009
,defbe48d
. It also should remove whatever test fragments were copied from the ancient configure, as well as some configure logic (potentially that device path stuff). I think this change still preserves the most important use-cases of OSS: BSDs, and the Linux OSS emulation (the latter for testing only). According to an OSS user, the 4front checks were probably broken anyway. The SunAudio stuff was probably for (Open)Solaris, which is dead. ao_oss.c itself will remain GPL, and still contains bugmen0t changes.
This commit is contained in:
parent
3e49133a25
commit
5c038e6999
@ -42,13 +42,7 @@
|
||||
#include "osdep/timer.h"
|
||||
#include "osdep/endian.h"
|
||||
|
||||
#if HAVE_SYS_SOUNDCARD_H
|
||||
#include <sys/soundcard.h>
|
||||
#else
|
||||
#if HAVE_SOUNDCARD_H
|
||||
#include <soundcard.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "audio/format.h"
|
||||
|
||||
@ -60,6 +54,9 @@
|
||||
// Define to 1 if SNDCTL_DSP_RESET should be used to reset without close.
|
||||
#define KEEP_DEVICE (defined(SNDCTL_DSP_RESET) && !defined(__NetBSD__))
|
||||
|
||||
#define PATH_DEV_DSP "/dev/dsp"
|
||||
#define PATH_DEV_MIXER "/dev/mixer"
|
||||
|
||||
struct priv {
|
||||
int audio_fd;
|
||||
int prepause_samples;
|
||||
|
@ -25,15 +25,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#if HAVE_SYS_SOUNDCARD_H
|
||||
#include <sys/soundcard.h>
|
||||
#else
|
||||
#if HAVE_SOUNDCARD_H
|
||||
#include <soundcard.h>
|
||||
#else
|
||||
#include <linux/soundcard.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "osdep/io.h"
|
||||
|
||||
|
@ -3,7 +3,7 @@ from waftools.checks.generic import *
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
__all__ = ["check_pthreads", "check_iconv", "check_lua", "check_oss_4front",
|
||||
__all__ = ["check_pthreads", "check_iconv", "check_lua",
|
||||
"check_cocoa", "check_openal", "check_rpi"]
|
||||
|
||||
pthreads_program = load_fragment('pthreads.c')
|
||||
@ -83,32 +83,6 @@ def check_lua(ctx, dependency_identifier):
|
||||
return True
|
||||
return False
|
||||
|
||||
def __get_osslibdir():
|
||||
cmd = ['sh', '-c', '. /etc/oss.conf && echo $OSSLIBDIR']
|
||||
p = Utils.subprocess.Popen(cmd, stdin=Utils.subprocess.PIPE,
|
||||
stdout=Utils.subprocess.PIPE,
|
||||
stderr=Utils.subprocess.PIPE)
|
||||
return p.communicate()[0].decode().rstrip()
|
||||
|
||||
def check_oss_4front(ctx, dependency_identifier):
|
||||
oss_libdir = __get_osslibdir()
|
||||
|
||||
# avoid false positive from native sys/soundcard.h
|
||||
if not oss_libdir:
|
||||
ctx.undefine(inflector.define_key(dependency_identifier))
|
||||
return False
|
||||
|
||||
soundcard_h = os.path.join(oss_libdir, "include/sys/soundcard.h")
|
||||
include_dir = os.path.join(oss_libdir, "include")
|
||||
|
||||
fn = check_cc(header_name=soundcard_h,
|
||||
defines=['PATH_DEV_DSP="/dev/dsp"',
|
||||
'PATH_DEV_MIXER="/dev/mixer"'],
|
||||
cflags='-I{0}'.format(include_dir),
|
||||
fragment=load_fragment('oss_audio.c'))
|
||||
|
||||
return fn(ctx, dependency_identifier)
|
||||
|
||||
def check_cocoa(ctx, dependency_identifier):
|
||||
fn = check_cc(
|
||||
fragment = load_fragment('cocoa.m'),
|
||||
|
@ -1,5 +0,0 @@
|
||||
#include <sys/soundcard.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
return SNDCTL_DSP_SETFRAGMENT;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#include <soundcard.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
return SNDCTL_DSP_SETFRAGMENT;
|
||||
}
|
||||
|
39
wscript
39
wscript
@ -470,36 +470,11 @@ audio_output_features = [
|
||||
'deps_neg': [ 'sdl2' ],
|
||||
'func': check_pkg_config('sdl'),
|
||||
'default': 'disable'
|
||||
}, {
|
||||
'name': 'oss-audio-4front',
|
||||
'desc': 'OSS (implementation from opensound.com)',
|
||||
'func': check_oss_4front,
|
||||
'groups' : [ 'oss-audio' ]
|
||||
}, {
|
||||
'name': 'oss-audio-native',
|
||||
'desc': 'OSS (platform-specific OSS implementation)',
|
||||
'func': check_cc(header_name='sys/soundcard.h',
|
||||
defines=['PATH_DEV_DSP="/dev/dsp"',
|
||||
'PATH_DEV_MIXER="/dev/mixer"'],
|
||||
fragment=load_fragment('oss_audio.c')),
|
||||
'deps_neg': [ 'oss-audio-4front' ],
|
||||
'groups' : [ 'oss-audio' ]
|
||||
}, {
|
||||
'name': 'oss-audio-sunaudio',
|
||||
'desc': 'OSS (emulation on top of SunAudio)',
|
||||
'func': check_cc(header_name='soundcard.h',
|
||||
lib='ossaudio',
|
||||
defines=['PATH_DEV_DSP="/dev/sound"',
|
||||
'PATH_DEV_MIXER="/dev/mixer"'],
|
||||
fragment=load_fragment('oss_audio_sunaudio.c')),
|
||||
'deps_neg': [ 'oss-audio-4front', 'oss-audio-native' ],
|
||||
'groups' : [ 'oss-audio' ]
|
||||
}, {
|
||||
'name': '--oss-audio',
|
||||
'desc': 'OSS audio output',
|
||||
'func': check_true,
|
||||
'deps_any': [ 'oss-audio-native', 'oss-audio-sunaudio',
|
||||
'oss-audio-4front' ]
|
||||
'desc': 'OSS',
|
||||
'func': check_cc(header_name='sys/soundcard.h'),
|
||||
'deps': [ 'posix' ],
|
||||
}, {
|
||||
'name': '--rsound',
|
||||
'desc': 'RSound audio output',
|
||||
@ -1007,14 +982,6 @@ def configure(ctx):
|
||||
|
||||
ctx.parse_dependencies(standalone_features)
|
||||
|
||||
ctx.define('HAVE_SYS_SOUNDCARD_H',
|
||||
'(HAVE_OSS_AUDIO_NATIVE || HAVE_OSS_AUDIO_4FRONT)',
|
||||
quote=False)
|
||||
|
||||
ctx.define('HAVE_SOUNDCARD_H',
|
||||
'HAVE_OSS_AUDIO_SUNAUDIO',
|
||||
quote=False)
|
||||
|
||||
ctx.load('generators.headers')
|
||||
|
||||
if not ctx.dependency_satisfied('build-date'):
|
||||
|
Loading…
Reference in New Issue
Block a user