From 8a9b64329c0e387dc59a1fca477a43c50f59ff34 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Jan 2016 18:36:06 +0100 Subject: Relicense some non-MPlayer source files to LGPL 2.1 or later This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone. --- audio/out/ao_wasapi.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'audio/out/ao_wasapi.h') diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h index 5ba2aa325c..642d92f66f 100644 --- a/audio/out/ao_wasapi.h +++ b/audio/out/ao_wasapi.h @@ -3,18 +3,18 @@ * * Original author: Jonathan Yong <10walls@gmail.com> * - * 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 . + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . */ #ifndef MP_AO_WASAPI_H_ -- cgit v1.2.3 From e927ff16661e7b5bd42cba2aa3f1bd3d4ac148ff Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Fri, 22 Jan 2016 21:35:51 -0800 Subject: ao_wasapi: correct check for specified device on default change Correctly avoid a reload if the current device was specified by the user through --audio-device. Previously, we only recognized if the user had specified --ao=wasapi:device=. --- audio/out/ao_wasapi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'audio/out/ao_wasapi.h') diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h index 642d92f66f..eaa056a931 100644 --- a/audio/out/ao_wasapi.h +++ b/audio/out/ao_wasapi.h @@ -119,6 +119,7 @@ char *mp_PKEY_to_str_buf(char *buf, size_t buf_size, const PROPERTYKEY *pkey); #define mp_PKEY_to_str(pkey) mp_PKEY_to_str_buf((char[42]){0}, 42, (pkey)) void wasapi_list_devs(struct ao *ao, struct ao_device_list *list); +bstr wasapi_get_specified_device_string(struct ao *ao); LPWSTR find_deviceID(struct ao *ao); void wasapi_dispatch(struct ao *ao); -- cgit v1.2.3 From 4d5d25fdbbe9b559eb1600520ef33fce380030c9 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Thu, 28 Jan 2016 00:45:38 -0800 Subject: ao_wasapi: add "wasapi" prefix to non-static find_deviceID function --- audio/out/ao_wasapi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/out/ao_wasapi.h') diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h index eaa056a931..c1181450a3 100644 --- a/audio/out/ao_wasapi.h +++ b/audio/out/ao_wasapi.h @@ -120,7 +120,7 @@ char *mp_PKEY_to_str_buf(char *buf, size_t buf_size, const PROPERTYKEY *pkey); void wasapi_list_devs(struct ao *ao, struct ao_device_list *list); bstr wasapi_get_specified_device_string(struct ao *ao); -LPWSTR find_deviceID(struct ao *ao); +LPWSTR wasapi_find_deviceID(struct ao *ao); void wasapi_dispatch(struct ao *ao); HRESULT wasapi_thread_init(struct ao *ao); -- cgit v1.2.3 From 84a3c21beb2f3360e4fda13179846406b4a24f7c Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Fri, 26 Feb 2016 06:58:09 -0800 Subject: ao_wasapi: replace laggy COM messaging with mp_dispatch_queue A COM message loop is apparently totally inappropriate for a low latency thread. It leads to audio glitches because the thread doesn't wake up fast enough when it should. It also causes mysterious correlations between the vo and ao thread (i.e., toggling fullscreen delays audio feed events). Instead use an mp_dispatch_queue to set/get volume/mute/session display name from the audio thread. This has the added benefit of obviating the need to marshal the associated interfaces from the audio thread. --- audio/out/ao_wasapi.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'audio/out/ao_wasapi.h') diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h index c1181450a3..3ae50159b3 100644 --- a/audio/out/ao_wasapi.h +++ b/audio/out/ao_wasapi.h @@ -66,6 +66,7 @@ typedef struct wasapi_state { HANDLE hAudioThread; // the audio thread itself HANDLE hWake; // thread wakeup event atomic_int thread_state; // enum wasapi_thread_state (what to do on wakeup) + struct mp_dispatch_queue *dispatch; // for volume/mute/session display // for setting the audio thread priority HANDLE hTask; @@ -83,25 +84,12 @@ typedef struct wasapi_state { UINT64 clock_frequency; // scale for position returned by GetPosition LARGE_INTEGER qpc_frequency; // frequency of Windows' high resolution timer - // WASAPI control (handles owned by audio thread but used by main thread) + // WASAPI control IAudioSessionControl *pSessionControl; // setting the stream title IAudioEndpointVolume *pEndpointVolume; // exclusive mode volume/mute ISimpleAudioVolume *pAudioVolume; // shared mode volume/mute DWORD vol_hw_support; // is hardware volume supported for exclusive-mode? - // Streams used to marshal the proxy objects. The thread owning the actual - // objects needs to marshal proxy objects into these streams, and the thread - // that wants the proxies unmarshals them from here. - IStream *sSessionControl; - IStream *sEndpointVolume; - IStream *sAudioVolume; - - // WASAPI proxy handles, for Single-Threaded Apartment communication. One is - // needed for each audio thread object that's accessed from the main thread. - IAudioSessionControl *pSessionControlProxy; - IAudioEndpointVolume *pEndpointVolumeProxy; - ISimpleAudioVolume *pAudioVolumeProxy; - // ao options int opt_exclusive; int opt_list; -- cgit v1.2.3