mirror of
https://github.com/mpv-player/mpv
synced 2025-02-01 04:31:39 +00:00
Make audio decoder description structs const
Make the per-decoder struct ad_functions and its ->info struct constants. Same for the mpcodecs_ad_drivers[] table of pointers to those structs.
This commit is contained in:
parent
def7ed045d
commit
170d69a71e
@ -16,34 +16,34 @@
|
||||
/* Missed vorbis, mad, dshow */
|
||||
|
||||
//extern ad_functions_t mpcodecs_ad_null;
|
||||
extern ad_functions_t mpcodecs_ad_mp3lib;
|
||||
extern ad_functions_t mpcodecs_ad_ffmpeg;
|
||||
extern ad_functions_t mpcodecs_ad_liba52;
|
||||
extern ad_functions_t mpcodecs_ad_hwac3;
|
||||
extern ad_functions_t mpcodecs_ad_hwmpa;
|
||||
extern ad_functions_t mpcodecs_ad_pcm;
|
||||
extern ad_functions_t mpcodecs_ad_dvdpcm;
|
||||
extern ad_functions_t mpcodecs_ad_alaw;
|
||||
extern ad_functions_t mpcodecs_ad_imaadpcm;
|
||||
extern ad_functions_t mpcodecs_ad_msadpcm;
|
||||
extern ad_functions_t mpcodecs_ad_dk3adpcm;
|
||||
extern ad_functions_t mpcodecs_ad_dk4adpcm;
|
||||
extern ad_functions_t mpcodecs_ad_dshow;
|
||||
extern ad_functions_t mpcodecs_ad_dmo;
|
||||
extern ad_functions_t mpcodecs_ad_acm;
|
||||
extern ad_functions_t mpcodecs_ad_msgsm;
|
||||
extern ad_functions_t mpcodecs_ad_faad;
|
||||
extern ad_functions_t mpcodecs_ad_libvorbis;
|
||||
extern ad_functions_t mpcodecs_ad_speex;
|
||||
extern ad_functions_t mpcodecs_ad_libmad;
|
||||
extern ad_functions_t mpcodecs_ad_realaud;
|
||||
extern ad_functions_t mpcodecs_ad_libdv;
|
||||
extern ad_functions_t mpcodecs_ad_qtaudio;
|
||||
extern ad_functions_t mpcodecs_ad_twin;
|
||||
extern ad_functions_t mpcodecs_ad_libmusepack;
|
||||
extern ad_functions_t mpcodecs_ad_libdca;
|
||||
extern const ad_functions_t mpcodecs_ad_mp3lib;
|
||||
extern const ad_functions_t mpcodecs_ad_ffmpeg;
|
||||
extern const ad_functions_t mpcodecs_ad_liba52;
|
||||
extern const ad_functions_t mpcodecs_ad_hwac3;
|
||||
extern const ad_functions_t mpcodecs_ad_hwmpa;
|
||||
extern const ad_functions_t mpcodecs_ad_pcm;
|
||||
extern const ad_functions_t mpcodecs_ad_dvdpcm;
|
||||
extern const ad_functions_t mpcodecs_ad_alaw;
|
||||
extern const ad_functions_t mpcodecs_ad_imaadpcm;
|
||||
extern const ad_functions_t mpcodecs_ad_msadpcm;
|
||||
extern const ad_functions_t mpcodecs_ad_dk3adpcm;
|
||||
extern const ad_functions_t mpcodecs_ad_dk4adpcm;
|
||||
extern const ad_functions_t mpcodecs_ad_dshow;
|
||||
extern const ad_functions_t mpcodecs_ad_dmo;
|
||||
extern const ad_functions_t mpcodecs_ad_acm;
|
||||
extern const ad_functions_t mpcodecs_ad_msgsm;
|
||||
extern const ad_functions_t mpcodecs_ad_faad;
|
||||
extern const ad_functions_t mpcodecs_ad_libvorbis;
|
||||
extern const ad_functions_t mpcodecs_ad_speex;
|
||||
extern const ad_functions_t mpcodecs_ad_libmad;
|
||||
extern const ad_functions_t mpcodecs_ad_realaud;
|
||||
extern const ad_functions_t mpcodecs_ad_libdv;
|
||||
extern const ad_functions_t mpcodecs_ad_qtaudio;
|
||||
extern const ad_functions_t mpcodecs_ad_twin;
|
||||
extern const ad_functions_t mpcodecs_ad_libmusepack;
|
||||
extern const ad_functions_t mpcodecs_ad_libdca;
|
||||
|
||||
ad_functions_t* mpcodecs_ad_drivers[] =
|
||||
const ad_functions_t * const mpcodecs_ad_drivers[] =
|
||||
{
|
||||
// &mpcodecs_ad_null,
|
||||
#ifdef USE_MP3LIB
|
||||
|
@ -9,7 +9,7 @@ typedef mp_codec_info_t ad_info_t;
|
||||
/* interface of video decoder drivers */
|
||||
typedef struct ad_functions
|
||||
{
|
||||
ad_info_t *info;
|
||||
const ad_info_t *info;
|
||||
int (*preinit)(sh_audio_t *sh);
|
||||
int (*init)(sh_audio_t *sh);
|
||||
void (*uninit)(sh_audio_t *sh);
|
||||
@ -18,7 +18,7 @@ typedef struct ad_functions
|
||||
} ad_functions_t;
|
||||
|
||||
// NULL terminated array of all drivers
|
||||
extern ad_functions_t* mpcodecs_ad_drivers[];
|
||||
extern const ad_functions_t * const mpcodecs_ad_drivers[];
|
||||
|
||||
// fallback if ADCTRL_RESYNC not implemented: sh_audio->a_in_buffer_len=0;
|
||||
#define ADCTRL_RESYNC_STREAM 1 /* resync, called after seeking! */
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "ad_internal.h"
|
||||
#include "osdep/timer.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Win32/ACM decoders",
|
||||
"acm",
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "config.h"
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"aLaw/uLaw audio decoder",
|
||||
"alaw",
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "mpbswap.h"
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Duck Corp. DK3 ADPCM decoder",
|
||||
"dk3adpcm",
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "ad_internal.h"
|
||||
#include "libaf/reorder_ch.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Win32/DMO decoders",
|
||||
"dmo",
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Win32/DirectShow decoders",
|
||||
"dshow",
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "help_mp.h"
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Uncompressed DVD/VOB LPCM audio decoder",
|
||||
"dvdpcm",
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "ad_internal.h"
|
||||
#include "libaf/reorder_ch.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"AAC (MPEG2/4 Advanced Audio Coding)",
|
||||
"faad",
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "mpbswap.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"FFmpeg/libavcodec audio decoders",
|
||||
"ffmpeg",
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
static int isdts = -1;
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"AC3/DTS pass-through S/PDIF",
|
||||
"hwac3",
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
//based on ad_hwac3.c and ad_libmad.c
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"MPEG audio pass-through (fake decoder)",
|
||||
"hwmpa",
|
||||
|
@ -69,7 +69,7 @@ static int adpcm_index[16] =
|
||||
// sign extend a 4-bit value
|
||||
#define SE_4BIT(x) if (x & 0x8) x -= 0x10;
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"IMA ADPCM audio decoder",
|
||||
"imaadpcm",
|
||||
|
@ -17,7 +17,7 @@ static void uninit(sh_audio_t *sh);
|
||||
static int control(sh_audio_t *sh,int cmd,void* arg, ...);
|
||||
static int decode_audio(sh_audio_t *sh,unsigned char *buffer,int minlen,int maxlen);
|
||||
|
||||
#define LIBAD_EXTERN(x) ad_functions_t mpcodecs_ad_##x = {\
|
||||
#define LIBAD_EXTERN(x) const ad_functions_t mpcodecs_ad_##x = {\
|
||||
&info,\
|
||||
preinit,\
|
||||
init,\
|
||||
|
@ -38,7 +38,7 @@ static sample_t a52_level = 1;
|
||||
float a52_drc_level = 1.0;
|
||||
static int a52_drc_action = DRC_NO_ACTION;
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"AC3 decoding with liba52",
|
||||
"liba52",
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include <dts.h>
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"DTS decoding with libdca",
|
||||
"libdca",
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Raw DV Audio Decoder",
|
||||
"libdv",
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info = {
|
||||
static const ad_info_t info = {
|
||||
"libmad mpeg audio decoder",
|
||||
"libmad",
|
||||
"A'rpi",
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Ogg/Vorbis audio decoder",
|
||||
"libvorbis",
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"MPEG layer-2, layer-3",
|
||||
"mp3lib",
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "libaf/af_format.h"
|
||||
#include "libvo/fastmemcpy.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Musepack audio decoder",
|
||||
"mpcdec",
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "mpbswap.h"
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"MS ADPCM audio decoder",
|
||||
"msadpcm",
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "config.h"
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"native GSM/MSGSM audio decoder",
|
||||
"msgsm",
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "libaf/af_format.h"
|
||||
#include "libaf/reorder_ch.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"Uncompressed PCM audio decoder",
|
||||
"pcm",
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "loader/ldt_keeper.h"
|
||||
#endif
|
||||
|
||||
static ad_info_t info = {
|
||||
static const ad_info_t info = {
|
||||
"QuickTime Audio Decoder",
|
||||
"qtaudio",
|
||||
"A'rpi",
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "ad_internal.h"
|
||||
#include "loader/wine/windef.h"
|
||||
|
||||
static ad_info_t info = {
|
||||
static const ad_info_t info = {
|
||||
"RealAudio decoder",
|
||||
"realaud",
|
||||
"Alex Beregszaszi",
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "config.h"
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info = {
|
||||
static const ad_info_t info = {
|
||||
"Sample audio decoder", // name of the driver
|
||||
"sample", // driver name. should be the same as filename without ad_
|
||||
"A'rpi", // writer/maintainer of _this_ file
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <speex/speex_header.h>
|
||||
#include "ad_internal.h"
|
||||
|
||||
static ad_info_t info = {
|
||||
static const ad_info_t info ={
|
||||
"Speex audio decoder",
|
||||
"speex",
|
||||
"Reimar Döffinger",
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "help_mp.h"
|
||||
|
||||
static ad_info_t info =
|
||||
static const ad_info_t info =
|
||||
{
|
||||
"TWinVQ decoder",
|
||||
"vqf",
|
||||
|
Loading…
Reference in New Issue
Block a user