From d58d4ec93c6a89cea3488689f12f6e7abd0617c9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 23 Oct 2013 19:07:27 +0200 Subject: audio/out: remove useless info struct and redundant fields --- audio/mixer.c | 2 +- audio/out/ao.c | 6 +++--- audio/out/ao.h | 14 ++------------ audio/out/ao_alsa.c | 9 +++------ audio/out/ao_coreaudio.c | 11 +++++------ audio/out/ao_dsound.c | 8 ++------ audio/out/ao_jack.c | 8 ++------ audio/out/ao_lavc.c | 8 ++------ audio/out/ao_null.c | 8 ++------ audio/out/ao_openal.c | 8 ++------ audio/out/ao_oss.c | 9 +++------ audio/out/ao_pcm.c | 10 ++++------ audio/out/ao_portaudio.c | 8 ++------ audio/out/ao_pulse.c | 8 ++------ audio/out/ao_rsound.c | 8 ++------ audio/out/ao_sdl.c | 8 ++------ audio/out/ao_sndio.c | 8 ++------ audio/out/ao_wasapi.c | 10 ++++------ mpvcore/mplayer.c | 9 ++------- 19 files changed, 47 insertions(+), 113 deletions(-) diff --git a/audio/mixer.c b/audio/mixer.c index f3e9d959aa..4ecfe2bdf4 100644 --- a/audio/mixer.c +++ b/audio/mixer.c @@ -303,7 +303,7 @@ static void restore_volume(struct mixer *mixer) int force_mute = -1; const char *prev_driver = mixer->driver; - mixer->driver = mixer->softvol ? "softvol" : ao->driver->info->short_name; + mixer->driver = mixer->softvol ? "softvol" : ao->driver->name; bool restore = mixer->softvol || ao->no_persistent_volume; diff --git a/audio/out/ao.c b/audio/out/ao.c index 416bec43f0..c21e58ccf6 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -102,8 +102,8 @@ static bool get_desc(struct m_obj_desc *dst, int index) return false; const struct ao_driver *ao = audio_out_drivers[index]; *dst = (struct m_obj_desc) { - .name = ao->info->short_name, - .description = ao->info->name, + .name = ao->name, + .description = ao->description, .priv_size = ao->priv_size, .priv_defaults = ao->priv_defaults, .options = ao->options, @@ -189,7 +189,7 @@ autoprobe: for (int i = 0; audio_out_drivers[i]; i++) { struct ao *ao = ao_create(true, global, input_ctx, encode_lavc_ctx, samplerate, format, channels, - (char *)audio_out_drivers[i]->info->short_name, NULL); + (char *)audio_out_drivers[i]->name, NULL); if (ao) return ao; } diff --git a/audio/out/ao.h b/audio/out/ao.h index 85301d79f4..3d64102ada 100644 --- a/audio/out/ao.h +++ b/audio/out/ao.h @@ -43,22 +43,12 @@ typedef struct ao_control_vol { float right; } ao_control_vol_t; -typedef struct ao_info { - /* driver name ("Matrox Millennium G200/G400" */ - const char *name; - /* short name (for config strings) ("mga") */ - const char *short_name; - /* author ("Aaron Holtzman ") */ - const char *author; - /* any additional comments */ - const char *comment; -} ao_info_t; - struct ao; struct ao_driver { bool encode; - const struct ao_info *info; + const char *name; + const char *description; int (*control)(struct ao *ao, enum aocontrol cmd, void *arg); int (*init)(struct ao *ao); void (*uninit)(struct ao *ao, bool cut_audio); diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index ff931e2a0b..d2c79c484c 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -2,6 +2,7 @@ * ALSA 0.9.x-1.x audio output driver * * Copyright (C) 2004 Alex Beregszaszi + * Zsolt Barat * * modified for real ALSA 0.9.0 support by Zsolt Barat * additional AC-3 passthrough support by Andy Lo A Foe @@ -731,12 +732,8 @@ static float get_delay(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_alsa = { - .info = &(const struct ao_info) { - "ALSA-0.9.x-1.x audio output", - "alsa", - "Alex Beregszaszi, Zsolt Barat ", - "under development" - }, + .description = "ALSA-0.9.x-1.x audio output", + .name = "alsa", .init = init, .uninit = uninit, .control = control, diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 878d92b0af..0044a9ba4c 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -4,6 +4,9 @@ * original copyright (C) Timothy J. Wood - Aug 2000 * ported to MPlayer libao2 by Dan Christiansen * + * Chris Roccati + * Stefano Pigozzi + * * The S/PDIF part of the code is based on the auhal audio output * module from VideoLAN: * Copyright (c) 2006 Derk-Jan Hartman @@ -697,12 +700,8 @@ static void audio_resume(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_coreaudio = { - .info = &(const struct ao_info) { - "CoreAudio (OS X Audio Output)", - "coreaudio", - "Timothy J. Wood, Dan Christiansen, Chris Roccati & Stefano Pigozzi", - "", - }, + .description = "CoreAudio (OS X Audio Output)", + .name = "coreaudio", .uninit = uninit, .init = init, .play = play, diff --git a/audio/out/ao_dsound.c b/audio/out/ao_dsound.c index 3002b67dcc..034f5d8446 100644 --- a/audio/out/ao_dsound.c +++ b/audio/out/ao_dsound.c @@ -634,12 +634,8 @@ static float get_delay(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_dsound = { - .info = &(const struct ao_info) { - "Windows DirectSound audio output", - "dsound", - "Gabor Szecsi ", - "" - }, + .description = "Windows DirectSound audio output", + .name = "dsound", .init = init, .uninit = uninit, .control = control, diff --git a/audio/out/ao_jack.c b/audio/out/ao_jack.c index 035df4ff8f..20dd0d4aab 100644 --- a/audio/out/ao_jack.c +++ b/audio/out/ao_jack.c @@ -337,12 +337,8 @@ static int play(struct ao *ao, void *data, int len, int flags) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_jack = { - .info = &(const struct ao_info) { - "JACK audio output", - "jack", - "Reimar Döffinger ", - "based on ao_sdl.c" - }, + .description = "JACK audio output", + .name = "jack", .init = init, .uninit = uninit, .get_space = get_space, diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c index bf42a75ca3..eb41710b82 100644 --- a/audio/out/ao_lavc.c +++ b/audio/out/ao_lavc.c @@ -633,12 +633,8 @@ static int play(struct ao *ao, void *data, int len, int flags) const struct ao_driver audio_out_lavc = { .encode = true, - .info = &(const struct ao_info) { - "audio encoding using libavcodec", - "lavc", - "Rudolf Polzer ", - "" - }, + .description = "audio encoding using libavcodec", + .name = "lavc", .init = init, .uninit = uninit, .get_space = get_space, diff --git a/audio/out/ao_null.c b/audio/out/ao_null.c index ba0f61ce34..ff6b12a1a6 100644 --- a/audio/out/ao_null.c +++ b/audio/out/ao_null.c @@ -117,12 +117,8 @@ static float get_delay(struct ao *ao) } const struct ao_driver audio_out_null = { - .info = &(const struct ao_info) { - "Null audio output", - "null", - "Tobias Diedrich ", - "", - }, + .description = "Null audio output", + .name = "null", .init = init, .uninit = uninit, .reset = reset, diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c index 599672658d..6fdc388711 100644 --- a/audio/out/ao_openal.c +++ b/audio/out/ao_openal.c @@ -292,12 +292,8 @@ static float get_delay(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_openal = { - .info = &(const struct ao_info) { - "OpenAL audio output", - "openal", - "Reimar Döffinger ", - "" - }, + .description = "OpenAL audio output", + .name = "openal", .init = init, .uninit = uninit, .control = control, diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index 5050f9771f..ed1b9468ef 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -3,6 +3,7 @@ * * This file is part of MPlayer. * + * Original author: A'rpi * Support for >2 output channels added 2001-11-25 * - Steve Davies * @@ -542,12 +543,8 @@ static float get_delay(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_oss = { - .info = &(const struct ao_info) { - "OSS/ioctl audio output", - "oss", - "A'rpi", - "" - }, + .description = "OSS/ioctl audio output", + .name = "oss", .init = init, .uninit = uninit, .control = control, diff --git a/audio/out/ao_pcm.c b/audio/out/ao_pcm.c index 7b5bc3e3dc..d2f5f791ec 100644 --- a/audio/out/ao_pcm.c +++ b/audio/out/ao_pcm.c @@ -3,6 +3,8 @@ * * This file is part of MPlayer. * + * Original author: Atmosfear + * * MPlayer 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 @@ -203,12 +205,8 @@ static int play(struct ao *ao, void *data, int len, int flags) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_pcm = { - .info = &(const struct ao_info) { - "RAW PCM/WAVE file writer audio output", - "pcm", - "Atmosfear", - "", - }, + .description = "RAW PCM/WAVE file writer audio output", + .name = "pcm", .init = init, .uninit = uninit, .get_space = get_space, diff --git a/audio/out/ao_portaudio.c b/audio/out/ao_portaudio.c index c9f55646a3..8b235f8806 100644 --- a/audio/out/ao_portaudio.c +++ b/audio/out/ao_portaudio.c @@ -372,12 +372,8 @@ static void resume(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_portaudio = { - .info = &(const struct ao_info) { - "PortAudio", - "portaudio", - "wm4", - "", - }, + .description = "PortAudio", + .name = "portaudio", .init = init, .uninit = uninit, .reset = reset, diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index a86871142f..89dac4d2cc 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -587,12 +587,8 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_pulse = { - .info = &(const struct ao_info) { - "PulseAudio audio output", - "pulse", - "Lennart Poettering", - "", - }, + .description = "PulseAudio audio output", + .name = "pulse", .control = control, .init = init, .uninit = uninit, diff --git a/audio/out/ao_rsound.c b/audio/out/ao_rsound.c index 5bfdbcef0f..162fb21feb 100644 --- a/audio/out/ao_rsound.c +++ b/audio/out/ao_rsound.c @@ -179,12 +179,8 @@ static float get_delay(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_rsound = { - .info = &(const struct ao_info) { - .name = "RSound output driver", - .short_name = "rsound", - .author = "Hans-Kristian Arntzen", - .comment = "", - }, + .description = "RSound output driver", + .name = "rsound", .init = init, .uninit = uninit, .reset = reset, diff --git a/audio/out/ao_sdl.c b/audio/out/ao_sdl.c index 4ca153b4dd..a42c0812cb 100644 --- a/audio/out/ao_sdl.c +++ b/audio/out/ao_sdl.c @@ -347,12 +347,8 @@ static float get_delay(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_sdl = { - .info = &(const struct ao_info) { - "SDL Audio", - "sdl", - "Rudolf Polzer ", - "" - }, + .description = "SDL Audio", + .name = "sdl", .init = init, .uninit = uninit, .get_space = get_space, diff --git a/audio/out/ao_sndio.c b/audio/out/ao_sndio.c index 0a1f9f3038..ab9eaf8197 100644 --- a/audio/out/ao_sndio.c +++ b/audio/out/ao_sndio.c @@ -317,12 +317,8 @@ static void audio_resume(struct ao *ao) #define OPT_BASE_STRUCT struct priv const struct ao_driver audio_out_sndio = { - .info = &(const struct ao_info) { - "sndio audio output", - "sndio", - "Alexandre Ratchov , Christian Neukirchen ", - "under development" - }, + .description = "sndio audio output", + .name = "sndio", .init = init, .uninit = uninit, .control = control, diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index d5860ae3ea..47c6fcfdb7 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -1,6 +1,8 @@ /* * This file is part of mpv. * + * 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 @@ -1369,12 +1371,8 @@ static float get_delay(struct ao *ao) #define OPT_BASE_STRUCT struct wasapi_state const struct ao_driver audio_out_wasapi = { - .info = &(const struct ao_info) { - "Windows WASAPI audio output (event mode)", - "wasapi", - "Jonathan Yong <10walls@gmail.com>", - "" - }, + .description = "Windows WASAPI audio output (event mode)", + .name = "wasapi", .init = init, .uninit = uninit, .control = control, diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c index 5b35821b31..bfc5f7c4e1 100644 --- a/mpvcore/mplayer.c +++ b/mpvcore/mplayer.c @@ -1726,14 +1726,9 @@ void reinit_audio_chain(struct MPContext *mpctx) } ao->buffer.start = talloc_new(ao); char *s = mp_audio_fmt_to_str(ao->samplerate, &ao->channels, ao->format); - MP_INFO(mpctx, "AO: [%s] %s\n", - ao->driver->info->short_name, s); + MP_INFO(mpctx, "AO: [%s] %s\n", ao->driver->name, s); talloc_free(s); - MP_VERBOSE(mpctx, "AO: Description: %s\nAO: Author: %s\n", - ao->driver->info->name, ao->driver->info->author); - if (strlen(ao->driver->info->comment) > 0) - MP_VERBOSE(mpctx, "AO: Comment: %s\n", - ao->driver->info->comment); + MP_VERBOSE(mpctx, "AO: Description: %s\n", ao->driver->description); } if (recreate_audio_filters(mpctx) < 0) -- cgit v1.2.3