Re: x11/vlc: sndio backend for testing

2012-05-24 Thread Brad Smith
On Tue, May 22, 2012 at 08:23:58PM +1000, Brett wrote:
 On Sun, 20 May 2012 23:59:48 +0200
 Alexandre Ratchov a...@caoua.org wrote:
 
  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
 
 Hi Alexandre and ports,
 
 I'm not sure if vlc played these before (I normally use mplayer) but
 .mkv and .webm files have no audio with these patches :-(

Yes, VLC very much could play such files, not being able to would be
a pretty big deal.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: x11/vlc: sndio backend for testing

2012-05-22 Thread Brett
On Sun, 20 May 2012 23:59:48 +0200
Alexandre Ratchov a...@caoua.org wrote:

 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

Hi Alexandre and ports,

I'm not sure if vlc played these before (I normally use mplayer) but .mkv and 
.webm files have no audio with these patches :-(

.avi .flv and .mp4 all played no problem.
 

File from http://www.youtube.com/watch?v=NIF8ij6BzzM gave the error message 
below:

$ vlc /data/radios_music/Lucy\ 9mm\ -\ Mohammed\ Ali.webm   
 
VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547)
[0x2094fd158] main xml reader error: XML reader not found
[0x20132b058] main libvlc: Running vlc with the default interface. Use 'cvlc' 
to use vlc without interface.
MKV/Ebml Parser: m_el[mi_level] == NULL
MKV/Ebml Parser: Up cannot escape itself
[0x2094f9158] qt4 interface error: Unable to load extensions module
MKV/Ebml Parser: m_el[mi_level] == NULL
MKV/Ebml Parser: Up cannot escape itself
[0x217138258] main audio output error: cannot find filter for simple conversion
[0x217138258] main audio output error: couldn't create audio output pipeline
[0x205eb0858] main decoder error: failed to create audio output
$ 

$ vlc film/Anime/Full/Full.mkv 
VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547)
[0x2021c7158] main xml reader error: XML reader not found
[0x20215e258] main libvlc: Running vlc with the default interface. Use 'cvlc' 
to use vlc without interface.
MKV/Ebml Parser: m_el[mi_level] == NULL
MKV/Ebml Parser: Up cannot escape itself
[0x2021c6a58] qt4 interface error: Unable to load extensions module
MKV/Ebml Parser: m_el[mi_level] == NULL
MKV/Ebml Parser: Up cannot escape itself
[mpeg4 @ 0x20db2b800] Invalid and inefficient vfw-avi packed B frames detected
[0x204157058] main audio output error: cannot find filter for simple conversion
[0x204157058] main audio output error: couldn't create audio output pipeline
[0x20d16ac58] main decoder error: failed to create audio output
MKV/Ebml Parser: m_el[mi_level] == NULL
MKV/Ebml Parser: Up cannot escape itself
[0x204157058] main audio output error: cannot find filter for simple conversion
[mpeg4 @ 0x22dc59800] Invalid and inefficient vfw-avi packed B frames detected
[0x204157058] main audio output error: couldn't create audio output pipeline
[0x20d244858] main decoder error: failed to create audio output
$ 




x11/vlc: sndio backend for testing

2012-05-20 Thread Alexandre Ratchov
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