diff options
author | wm4 <wm4@nowhere> | 2015-06-26 23:06:37 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-26 23:06:37 +0200 |
commit | 6147bcce359358855ad02d8d5cbd6575d39b0449 (patch) | |
tree | 5cb8bafc418cd71b68f95766ad01b3312feed518 /audio/out/ao_dsound.c | |
parent | d6737c5fab489964558b1eed934969c4f151912d (diff) | |
download | mpv-6147bcce359358855ad02d8d5cbd6575d39b0449.tar.bz2 mpv-6147bcce359358855ad02d8d5cbd6575d39b0449.tar.xz |
audio: fix format function consistency issues
Replace all the check macros with function calls. Give them all the
same case and naming schema.
Drop af_fmt2bits(). Only af_fmt2bps() survives as af_fmt_to_bytes().
Introduce af_fmt_is_pcm(), and use it in situations that used
!AF_FORMAT_IS_SPECIAL. Nobody really knew what a "special" format
was. It simply meant "not PCM".
Diffstat (limited to 'audio/out/ao_dsound.c')
-rw-r--r-- | audio/out/ao_dsound.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/audio/out/ao_dsound.c b/audio/out/ao_dsound.c index 8b1e10a10b..c581bf512e 100644 --- a/audio/out/ao_dsound.c +++ b/audio/out/ao_dsound.c @@ -444,7 +444,7 @@ static int init(struct ao *ao) int format = af_fmt_from_planar(ao->format); int rate = ao->samplerate; - if (!AF_FORMAT_IS_IEC61937(format)) { + if (!af_fmt_is_spdif(format)) { struct mp_chmap_sel sel = {0}; mp_chmap_sel_add_waveext(&sel); if (!ao_chmap_sel_adjust(ao, &sel, &ao->channels)) @@ -456,7 +456,7 @@ static int init(struct ao *ao) case AF_FORMAT_U8: break; default: - if (AF_FORMAT_IS_IEC61937(format)) + if (af_fmt_is_spdif(format)) break; MP_VERBOSE(ao, "format %s not supported defaulting to Signed 16-bit Little-Endian\n", af_fmt_to_str(format)); @@ -465,7 +465,7 @@ static int init(struct ao *ao) //set our audio parameters ao->samplerate = rate; ao->format = format; - ao->bps = ao->channels.num * rate * af_fmt2bps(format); + ao->bps = ao->channels.num * rate * af_fmt_to_bytes(format); int buffersize = ao->bps * p->cfg_buffersize / 1000; MP_VERBOSE(ao, "Samplerate:%iHz Channels:%i Format:%s\n", rate, ao->channels.num, af_fmt_to_str(format)); @@ -478,7 +478,7 @@ static int init(struct ao *ao) ? sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX) : 0; wformat.Format.nChannels = ao->channels.num; wformat.Format.nSamplesPerSec = rate; - if (AF_FORMAT_IS_IEC61937(format)) { + if (af_fmt_is_spdif(format)) { // Whether it also works with e.g. DTS is unknown, but probably does. wformat.Format.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF; wformat.Format.wBitsPerSample = 16; @@ -486,7 +486,7 @@ static int init(struct ao *ao) } else { wformat.Format.wFormatTag = (ao->channels.num > 2) ? WAVE_FORMAT_EXTENSIBLE : WAVE_FORMAT_PCM; - int bps = af_fmt2bps(format); + int bps = af_fmt_to_bytes(format); wformat.Format.wBitsPerSample = bps * 8; wformat.Format.nBlockAlign = wformat.Format.nChannels * bps; } |