This diff is supposed to make video smoother with the sndio
backend. It also adds support for 24-bit encodings, makes use of
the sndiod volume knob, removes the need for portaudio and makes
sndio the default backend on OpenBSD.
I'm very interested in any regressions, and stuff that used to
work, possibly with other backends, but that doesn't work with this
one.
Comments? OK?
-- Alexandre
Index: Makefile
===
RCS file: /cvs/ports/x11/vlc/Makefile,v
retrieving revision 1.147
diff -u -p -r1.147 Makefile
--- Makefile3 May 2012 06:51:25 - 1.147
+++ Makefile20 May 2012 21:41:50 -
@@ -8,7 +8,7 @@ COMMENT-jack= JACK audio output module f
V= 2.0.1
DISTNAME= vlc-${V}
PKGNAME-main= ${DISTNAME}
-REVISION-main= 0
+REVISION-main= 1
PKGNAME-jack= vlc-jack-${V}
CATEGORIES=x11
MASTER_SITES= http://download.videolan.org/pub/videolan/vlc/${V}/
@@ -37,10 +37,10 @@ WANTLIB-main= GL ICE lib/qt4/QtGui QtCor
gmp gnutls gobject-2.0 gpg-error gsm gthread-2.0 gtk-x11-2.0 \
hogweed jpeg matroska mp3lame nettle notify orc-0.4 ogg \
p11-kit pango-1.0 pangocairo-1.0 pangoft2-1.0 pcre pixman-1 \
- png portaudio postproc proxy pthread-stubs pthread samplerate \
- sndio schroedinger-1.0=2.0 sndio speex speexdsp swscale tag \
- tar tasn1 tiff theoradec theoraenc usbhid vorbis vorbisenc \
- vpx webp x264 xcb-composite xcb-keysyms xcb-randr xcb-render \
+ png postproc proxy pthread-stubs pthread samplerate sndio \
+ schroedinger-1.0=2.0 sndio speex speexdsp swscale tag tar \
+ tasn1 tiff theoradec theoraenc usbhid vorbis vorbisenc vpx \
+ webp x264 xcb-composite xcb-keysyms xcb-randr xcb-render \
xcb-shape xcb-shm xcb-xfixes xcb-xv xcb xml2 xvidcore z \
${WANTLIB-common}
WANTLIB-jack= jack vlccore ${WANTLIB-common}
@@ -60,7 +60,6 @@ LIB_DEPENDS-main= ${LIB_DEPENDS} \
audio/libcddb \
audio/libsamplerate \
audio/libvorbis \
- audio/portaudio-svn \
audio/speex \
audio/taglib \
devel/fribidi \
@@ -130,6 +129,7 @@ CONFIGURE_ARGS+=--disable-a52 \
--disable-mpc \
--disable-mtp \
--disable-neon \
+ --disable-portaudio \
--disable-projectm \
--disable-pulse \
--disable-shout \
Index: files/sndio.c
===
RCS file: /cvs/ports/x11/vlc/files/sndio.c,v
retrieving revision 1.1
diff -u -p -r1.1 sndio.c
--- files/sndio.c 23 Apr 2012 13:47:08 - 1.1
+++ files/sndio.c 20 May 2012 21:41:50 -
@@ -2,6 +2,7 @@
* sndio.c : sndio plugin for VLC
*
* Copyright (C) 2012 R??mi Denis-Courmont
+ * Copyright (C) 2012 Alexandre Ratchov
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -27,6 +28,7 @@
#include vlc_common.h
#include vlc_plugin.h
#include vlc_aout.h
+#include vlc_aout_intf.h
#include sndio.h
@@ -35,159 +37,208 @@ static void Close (vlc_object_t *);
vlc_module_begin ()
set_shortname (sndio)
-set_description (N_(OpenBSD sndio audio output))
+set_description (N_(sndio audio output))
set_category (CAT_AUDIO)
set_subcategory (SUBCAT_AUDIO_AOUT)
-set_capability (audio output, 0)
+set_capability (audio output, 200)
set_callbacks (Open, Close )
vlc_module_end ()
static void Play (audio_output_t *, block_t *);
static void Pause (audio_output_t *, bool, mtime_t);
+static void Flush (audio_output_t *, bool);
+static int VolumeSet(audio_output_t *, float, bool);
+
+struct aout_sys_t
+{
+struct sio_hdl *hdl;
+int delay, bpf;
+};
+
+static void onmove (void *addr, int delta)
+{
+audio_output_t *aout = (audio_output_t *)addr;
+struct aout_sys_t *sys = (struct aout_sys_t *)aout-sys;
+
+sys-delay -= delta;
+}
/** Initializes an sndio playback stream */
static int Open (vlc_object_t *obj)
{
+char fourcc[4];
+unsigned int chans;
audio_output_t *aout = (audio_output_t *)obj;
+struct aout_sys_t *sys;
+struct sio_hdl *hdl;
+struct sio_par par;
-struct sio_hdl *sio = sio_open (NULL, SIO_PLAY, 0 /* blocking */);
-if (sio == NULL)
+hdl = sio_open (NULL, SIO_PLAY, 0);
+if (hdl == NULL)
{
msg_Err (obj, cannot create audio playback stream);
return VLC_EGENERIC;
}
-struct sio_par par;
sio_initpar (par);
-par.bits = 16;
-par.bps = par.bits 3;
-par.sig = 1;
-par.le = SIO_LE_NATIVE;
+vlc_fourcc_to_char