[MPlayer-dev-eng] [PATCH] ao_dart
Diego Biurrun
diego at biurrun.de
Mon Feb 16 12:47:00 CET 2009
On Mon, Feb 16, 2009 at 06:13:29PM +0900, KO Myung-Hun wrote:
> [...]
>
> --- libao2/ao_dart.c (revision 0)
> +++ libao2/ao_dart.c (revision 0)
> @@ -0,0 +1,266 @@
> +/*
> + * OS/2 DART audio output driver for MPlayer
Drop "for MPlayer", what else is this supposed to be for?
> +#define INCL_DOS
> +#include <os2.h>
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <sys/time.h>
> +#include <float.h>
> +
> +#include "config.h"
> +#include "libaf/af_format.h"
> +#include "audio_out.h"
> +#include "audio_out_internal.h"
> +#include "mp_msg.h"
> +#include "libvo/fastmemcpy.h"
> +#include "subopt-helper.h"
> +
> +#include "dart.h"
dart.h must be a system header, use <> for it and place it above with
the other system headers.
> +static ULONG APIENTRY dart_audio_callback(PVOID pCBData, PVOID pBuffer, ULONG ulSize)
Please try to keep lines below 80 characters where reasonably posible.
> +static void print_help(void)
> +{
> + mp_msg(MSGT_AO, MSGL_FATAL,
> + "\n-ao dart commandline help:\n"
one space too much
> +// open & setup audio device
set up
> + switch(format) {
switch (
> + if (dartInit(0, af_fmt2bits(format), rate, MCI_WAVE_FORMAT_PCM, channels,
> + 2, n * nDartSamples, !fNoShare, dart_audio_callback, NULL))
two spaces too much..
> + ao_data.channels = channels;
> + ao_data.samplerate = rate;
> + ao_data.format = format;
> + ao_data.bps = channels * rate * (af_fmt2bits(format) >> 3);
> + ao_data.outburst = n * OUTBURST_SAMPLES;
> + ao_data.buffersize = m_nBufSize;
This could be aligned.
> +static int play(void *data, int len, int flags)
> +{
> + int start_pos, end_pos;
> +
> + if (!(flags & AOPLAY_FINAL_CHUNK))
> + len = (len / ao_data.outburst) * ao_data.outburst;
> +
> + if (len == 0)
!len
> --- DOCS/man/en/mplayer.1 (revision 28593)
> +++ DOCS/man/en/mplayer.1 (working copy)
> @@ -2836,6 +2836,18 @@
> .TP
> +.B dart (OS/2 only)
> +OS/2 DART audio output driver
> +.PD 0
> +.RSs
> +.IPs noshare
> +Open DART as exclusive mode
s/as/in/, end in a period.
> +.IPs bufsize=<size>
> +Set buffer size to <size> in samples, default 2048
Set buffer size to <size> in samples (default: 2048).
Diego
More information about the MPlayer-dev-eng
mailing list