mirror of https://github.com/mpv-player/mpv
ao_alsa: change license to LGPL
Looks like this is covered by LGPL relicensing agreements now. Notes about contributors who could not be reached or who didn't agree: Commit7fccb6486e
has tons of mp_msg changes look like they are not copyrightable (even if they were, all mp_msg calls were rewritten in mpv times again). The additional play() change looks suspicious, but the function was rewritten several times anyway (first time after that commit in4f40ec312
). Commit89ed1748ae
was rewritten in commit325311af3
and then again several times after that. Basically all this code is unnecessary in modern mpv and has been removed. No code survived from the following commits:4d31c3c53
,61ecf838f2
,d38968bd
,4deb67c3f
. At least two cosmetic typo fixes are not considered as well. Commit22bb046ad
is reverted (this wasn't a valid warning anyway, just a C++-ism icc applied to C). Using the constants is nicer, but at least I don't have to decide whether that change was copyrightable.
This commit is contained in:
parent
b2a08db71a
commit
274cc06aaf
|
@ -37,7 +37,6 @@ them quite central:
|
|||
- no audio filtering, which breaks: --volume, --af, replaygain, pitch
|
||||
correction, fine control about downmix/upmix/resampling behavior
|
||||
- Linux X11 video output
|
||||
- Linux audio output via ALSA (PulseAudio works)
|
||||
- BSD audio output via OSS
|
||||
- NVIDIA/Linux hardware decoding (vdpau, although CUDA usually works)
|
||||
- many builtin video filters (use libavfilter instead)
|
||||
|
@ -59,7 +58,6 @@ The following files are still GPL only (--enable-lgpl disables them):
|
|||
audio/filter/af_lavfi.c as above
|
||||
audio/filter/af_scaletempo.c as above
|
||||
audio/filter/af_rubberband.c as above
|
||||
audio/out/ao_alsa.c chaotic history, one later author did not decide
|
||||
audio/out/ao_jack.c will stay GPL
|
||||
audio/out/ao_oss.c will stay GPL
|
||||
audio/audio.* needed by af code only
|
||||
|
|
|
@ -12,18 +12,18 @@
|
|||
*
|
||||
* This file is part of mpv.
|
||||
*
|
||||
* mpv is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
* mpv is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* mpv is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
@ -49,10 +49,6 @@
|
|||
#include "internal.h"
|
||||
#include "audio/format.h"
|
||||
|
||||
#if !HAVE_GPL
|
||||
#error GPL only
|
||||
#endif
|
||||
|
||||
struct ao_alsa_opts {
|
||||
char *mixer_device;
|
||||
char *mixer_name;
|
||||
|
@ -186,15 +182,13 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
|
|||
ao_control_vol_t *vol = arg;
|
||||
set_vol = vol->left / f_multi + pmin + 0.5;
|
||||
|
||||
err = snd_mixer_selem_set_playback_volume
|
||||
(elem, SND_MIXER_SCHN_FRONT_LEFT, set_vol);
|
||||
err = snd_mixer_selem_set_playback_volume(elem, 0, set_vol);
|
||||
CHECK_ALSA_ERROR("Error setting left channel");
|
||||
MP_DBG(ao, "left=%li, ", set_vol);
|
||||
|
||||
set_vol = vol->right / f_multi + pmin + 0.5;
|
||||
|
||||
err = snd_mixer_selem_set_playback_volume
|
||||
(elem, SND_MIXER_SCHN_FRONT_RIGHT, set_vol);
|
||||
err = snd_mixer_selem_set_playback_volume(elem, 1, set_vol);
|
||||
CHECK_ALSA_ERROR("Error setting right channel");
|
||||
MP_DBG(ao, "right=%li, pmin=%li, pmax=%li, mult=%f\n",
|
||||
set_vol, pmin, pmax, f_multi);
|
||||
|
@ -202,11 +196,9 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
|
|||
}
|
||||
case AOCONTROL_GET_VOLUME: {
|
||||
ao_control_vol_t *vol = arg;
|
||||
snd_mixer_selem_get_playback_volume
|
||||
(elem, SND_MIXER_SCHN_FRONT_LEFT, &get_vol);
|
||||
snd_mixer_selem_get_playback_volume(elem, 0, &get_vol);
|
||||
vol->left = (get_vol - pmin) * f_multi;
|
||||
snd_mixer_selem_get_playback_volume
|
||||
(elem, SND_MIXER_SCHN_FRONT_RIGHT, &get_vol);
|
||||
snd_mixer_selem_get_playback_volume(elem, 1, &get_vol);
|
||||
vol->right = (get_vol - pmin) * f_multi;
|
||||
MP_DBG(ao, "left=%f, right=%f\n", vol->left, vol->right);
|
||||
break;
|
||||
|
@ -216,11 +208,9 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
|
|||
if (!snd_mixer_selem_has_playback_switch(elem))
|
||||
goto alsa_error;
|
||||
if (!snd_mixer_selem_has_playback_switch_joined(elem)) {
|
||||
snd_mixer_selem_set_playback_switch
|
||||
(elem, SND_MIXER_SCHN_FRONT_RIGHT, !*mute);
|
||||
snd_mixer_selem_set_playback_switch(elem, 1, !*mute);
|
||||
}
|
||||
snd_mixer_selem_set_playback_switch
|
||||
(elem, SND_MIXER_SCHN_FRONT_LEFT, !*mute);
|
||||
snd_mixer_selem_set_playback_switch(elem, 0, !*mute);
|
||||
break;
|
||||
}
|
||||
case AOCONTROL_GET_MUTE: {
|
||||
|
@ -228,12 +218,10 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
|
|||
if (!snd_mixer_selem_has_playback_switch(elem))
|
||||
goto alsa_error;
|
||||
int tmp = 1;
|
||||
snd_mixer_selem_get_playback_switch
|
||||
(elem, SND_MIXER_SCHN_FRONT_LEFT, &tmp);
|
||||
snd_mixer_selem_get_playback_switch(elem, 0, &tmp);
|
||||
*mute = !tmp;
|
||||
if (!snd_mixer_selem_has_playback_switch_joined(elem)) {
|
||||
snd_mixer_selem_get_playback_switch
|
||||
(elem, SND_MIXER_SCHN_FRONT_RIGHT, &tmp);
|
||||
snd_mixer_selem_get_playback_switch(elem, 1, &tmp);
|
||||
*mute &= !tmp;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue