summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-26 23:06:37 +0200
committerwm4 <wm4@nowhere>2015-06-26 23:06:37 +0200
commit6147bcce359358855ad02d8d5cbd6575d39b0449 (patch)
tree5cb8bafc418cd71b68f95766ad01b3312feed518 /audio/out/ao_lavc.c
parentd6737c5fab489964558b1eed934969c4f151912d (diff)
downloadmpv-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_lavc.c')
-rw-r--r--audio/out/ao_lavc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c
index b322982566..0106a64475 100644
--- a/audio/out/ao_lavc.c
+++ b/audio/out/ao_lavc.c
@@ -136,7 +136,7 @@ static int init(struct ao *ao)
select_format(ao, codec);
- ac->sample_size = af_fmt2bps(ao->format);
+ ac->sample_size = af_fmt_to_bytes(ao->format);
ac->stream->codec->sample_fmt = af_to_avformat(ao->format);
ac->stream->codec->bits_per_raw_sample = ac->sample_size * 8;
@@ -241,7 +241,7 @@ static int encode(struct ao *ao, double apts, void **data)
frame->format = af_to_avformat(ao->format);
frame->nb_samples = ac->aframesize;
- size_t num_planes = AF_FORMAT_IS_PLANAR(ao->format) ? ao->channels.num : 1;
+ size_t num_planes = af_fmt_is_planar(ao->format) ? ao->channels.num : 1;
assert(num_planes <= AV_NUM_DATA_POINTERS);
for (int n = 0; n < num_planes; n++)
frame->extended_data[n] = data[n];
@@ -350,7 +350,7 @@ static int play(struct ao *ao, void **data, int samples, int flags)
double pts = ectx->last_audio_in_pts;
pts += ectx->samples_since_last_pts / (double)ao->samplerate;
- size_t num_planes = AF_FORMAT_IS_PLANAR(ao->format) ? ao->channels.num : 1;
+ size_t num_planes = af_fmt_is_planar(ao->format) ? ao->channels.num : 1;
void *tempdata = NULL;
void *padded[MP_NUM_CHANNELS];