summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-11-23 16:24:02 +0100
committerwm4 <wm4@nowhere>2017-11-23 16:43:59 +0100
commit274cc06aaf7ce764164898b31951c0d03b8c3638 (patch)
tree65afb2f3b805ab965d15071b049b609fb1ed72f8
parentb2a08db71a066817dc8477fb0694fd767b520e65 (diff)
downloadmpv-274cc06aaf7ce764164898b31951c0d03b8c3638.tar.bz2
mpv-274cc06aaf7ce764164898b31951c0d03b8c3638.tar.xz
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: Commit 7fccb6486e 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 in 4f40ec312). Commit 89ed1748ae was rewritten in commit 325311af3 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. Commit 22bb046ad 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.
-rw-r--r--Copyright2
-rw-r--r--audio/out/ao_alsa.c42
-rw-r--r--wscript1
3 files changed, 15 insertions, 30 deletions
diff --git a/Copyright b/Copyright
index 63470c717c..aea1d98166 100644
--- a/Copyright
+++ b/Copyright
@@ -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
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index 3be156232a..39c3f03118 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -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;
diff --git a/wscript b/wscript
index cbff083f59..77b2ed4dd2 100644
--- a/wscript
+++ b/wscript
@@ -546,7 +546,6 @@ audio_output_features = [
}, {
'name': '--alsa',
'desc': 'ALSA audio output',
- 'deps': 'gpl',
'func': check_pkg_config('alsa', '>= 1.0.18'),
}, {
'name': '--coreaudio',