Branch: master

8d5f4c4d 2014-11-26 12:43:21 Slávek Banko
Fix FTBFS in oggPlayObject_impl.h on openbsd because semun definition

Signed-off-by: Slávek Banko <slavek.banko@...>
M oggvorbis_artsplugin/oggPlayObject_impl.h
diff --git a/oggvorbis_artsplugin/oggPlayObject_impl.h b/oggvorbis_artsplugin/oggPlayObject_impl.h
index 2f1b0c0..16a4ae2 100644
--- a/oggvorbis_artsplugin/oggPlayObject_impl.h
+++ b/oggvorbis_artsplugin/oggPlayObject_impl.h
@@ -1,7 +1,7 @@
 #ifndef OGGPLAYER_IMPL_H
 #define OGGPLAYER_IMPL_H "$Id$"
 
-#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) || defined(__DragonFly__)
+#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) || defined(__DragonFly__) || defined(__OpenBSD__)
 /* union semun is defined by including <sys/sem.h> */
 #else
 /* according to X/OPEN we have to define it ourselves */
1761a6cd 2014-11-26 12:44:37 François Andriot
Fix missing default openbsd cd device in kscd

Signed-off-by: François Andriot <francois.andriot@...>
M kscd/libwm/include/wm_config.h
diff --git a/kscd/libwm/include/wm_config.h b/kscd/libwm/include/wm_config.h
index 6de68f3..a8c574e 100644
--- a/kscd/libwm/include/wm_config.h
+++ b/kscd/libwm/include/wm_config.h
@@ -179,6 +179,21 @@
 #endif /* hpux */
 
 /******************************************************************
+ * OpenBSD
+ ******************************************************************
+ ****    ****     ***      **   ***  **     ****    ***    ********
+ ***  **  ***  **  **  ******    **  **  **  **  ******  *  *******
+ ***  **  ***     ***    ****  *  *  **    ******  ****  **  ******
+ ***  **  ***  ******  ******  **    **  **  ******  **  *  *******
+ ****    ****  ******      **  ***   **     ****    ***    ********
+ ******************************************************************/
+#if defined(__OpenBSD__)
+
+#define DEFAULT_CD_DEVICE      "/dev/rcd0c"
+
+#endif /* OpenBSD */
+
+/******************************************************************
  * Irix
  ******************************************************************
  ***      **     ***      **  **  *********************************
79546240 2014-11-26 12:45:57 François Andriot
Fix FTBFS in kscd on openbsd because missing scsi_cd.h

Signed-off-by: François Andriot <francois.andriot@...>
M kscd/libwm/plat_openbsd.c
diff --git a/kscd/libwm/plat_openbsd.c b/kscd/libwm/plat_openbsd.c
index 5786284..7ee1100 100644
--- a/kscd/libwm/plat_openbsd.c
+++ b/kscd/libwm/plat_openbsd.c
@@ -57,7 +57,6 @@
 #include <sys/scsiio.h>
 #include <scsi/scsi_all.h>
 #include <scsi/cd.h>
-#include <scsi/scsi_cd.h>
 
 #include "include/wm_struct.h"
 #include "include/wm_cdtext.h"
@@ -127,10 +126,12 @@
   
   find_drive_struct(vendor, model, rev);
   
-  (d->init)(d);
-  
   d->fd = fd;
   
+  if (d->proto->gen_init) {
+    return (d->proto->gen_init)(d);
+  }
+
   return (0);
 } /* wmcd_open() */
 
@@ -314,7 +315,7 @@
  * Play the CD from one position to another (both in frames.)
  */
 int
-gen_play(struct wm_drive *d, int start, int end)
+gen_play(struct wm_drive *d, int start, int end, int realstart)
 {
   struct ioc_play_msf	msf;
   
e9500088 2014-11-26 12:47:39 François Andriot
Fix FTBFS in tdeioslave/audiocd/plugins/wav on openbsd

Signed-off-by: François Andriot <francois.andriot@...>
M tdeioslave/audiocd/plugins/wav/encodercda.cpp
diff --git a/tdeioslave/audiocd/plugins/wav/encodercda.cpp b/tdeioslave/audiocd/plugins/wav/encodercda.cpp
index ef8522d..70ca37f 100644
--- a/tdeioslave/audiocd/plugins/wav/encodercda.cpp
+++ b/tdeioslave/audiocd/plugins/wav/encodercda.cpp
@@ -44,7 +44,9 @@
 {
   #include <cdda_interface.h>
 }
-
+#ifdef __OpenBSD__
+#undef swap16
+#endif
 inline int16_t swap16 (int16_t i)
 {
   return (((i >> 8) & 0xFF) | ((i << 8) & 0xFF00));
9f3f3804 2014-11-26 12:48:24 François Andriot
Fix FTBFS in tdeioslave/audiocd/plugins/lame on openbsd

Signed-off-by: François Andriot <francois.andriot@...>
M tdeioslave/audiocd/plugins/lame/encoderlame.cpp
diff --git a/tdeioslave/audiocd/plugins/lame/encoderlame.cpp b/tdeioslave/audiocd/plugins/lame/encoderlame.cpp
index 0e2ddef..8af2762 100644
--- a/tdeioslave/audiocd/plugins/lame/encoderlame.cpp
+++ b/tdeioslave/audiocd/plugins/lame/encoderlame.cpp
@@ -17,7 +17,14 @@
 */
 
 #include <config.h>
+
+#ifdef __OpenBSD__
+#include <sys/types.h>
+#include <sys/endian.h>
+#else
 #include <endian.h>
+#endif
+
 #include "encoderlame.h"
 #include "encoderlameconfig.h"
 #include "audiocd_lame_encoder.h"
164caede 2014-11-26 12:49:11 François Andriot
Fix build order to avoid FTBFS

Signed-off-by: François Andriot <francois.andriot@...>
M Makefile.am.in
diff --git a/Makefile.am.in b/Makefile.am.in
index aaccab8..648f5ea 100644
--- a/Makefile.am.in
+++ b/Makefile.am.in
@@ -7,6 +7,7 @@
 COMPILE_AFTER_arts = noatun krec akode_artsplugin
 COMPILE_AFTER_mpeglib = mpeglib_artsplug
 COMPILE_AFTER_libkcddb = kaudiocreator tdeioslave kscd
+COMPILE_AFTER_kscd = kaudiocreator tdeioslave
 COMPILE_AFTER_akode = juk
 
 MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 SUBDIRS
6726351d 2014-11-26 12:50:24 François Andriot
Add sndio support for openbsd

Signed-off-by: François Andriot <francois.andriot@...>
A mpeglib/lib/util/audio/audioIO_sndio.cpp
M mpeglib/lib/util/audio/audioIO.cpp
diff --git a/mpeglib/lib/util/audio/audioIO.cpp b/mpeglib/lib/util/audio/audioIO.cpp
index d066210..f2a1f7c 100644
--- a/mpeglib/lib/util/audio/audioIO.cpp
+++ b/mpeglib/lib/util/audio/audioIO.cpp
@@ -26,8 +26,12 @@
 #endif
 
 #ifdef OS_BSD
+#ifdef __OpenBSD__
+  #include "audioIO_sndio.cpp"
+#else
   #include "audioIO_Linux.cpp"
 #endif
+#endif
 
 #if defined(OS_IRIX) || defined(OS_IRIX64)
   #include "audioIO_IRIX.cpp"
diff --git a/mpeglib/lib/util/audio/audioIO_sndio.cpp b/mpeglib/lib/util/audio/audioIO_sndio.cpp
new file mode 100644
index 0000000..6f63262
--- /dev/null
+++ b/mpeglib/lib/util/audio/audioIO_sndio.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2010 Jacob Meuser <jakemsr@...>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <sndio.h>
+
+#include "audioIO.h"
+
+static struct sio_hdl *hdl;
+static struct sio_par par;
+
+int
+audioConstruct()
+{
+	hdl = NULL;
+	return true;
+}
+
+void
+audioDestruct()
+{
+}
+
+int
+audioOpen()
+{
+	hdl = sio_open(NULL, SIO_PLAY, 0);
+	if (hdl == NULL) {
+		fprintf(stderr, "unable to open audio device\n");
+		return 0;
+	}
+
+	return true;
+}
+
+inline void
+audioFlush()
+{
+}
+
+void
+audioClose()
+{
+	if (hdl != NULL)
+		sio_close(hdl);
+}
+
+void
+audioInit(int sampleSize, int frequency, int stereo, int sign, int big)
+{
+	sio_initpar(&par);
+
+	par.bits = sampleSize;
+	par.sig = sign ? 1 : 0;
+	par.le = big ? 0 : 1;
+	par.rate = frequency;
+	par.pchan = stereo ? 2 : 1;
+
+	if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par))
+		fprintf(stderr, "error setting sndio parameters\n");
+  
+	if (par.bits != sampleSize ||
+	    par.sig != sign ? 1 : 0 ||
+	    par.le != big ? 0 : 1 ||
+	    par.rate != frequency ||
+	    par.pchan != stereo ? 2 : 1)
+		fprintf(stderr, "could not set requested audio parameters");
+
+	if (!sio_start(hdl))
+		fprintf(stderr, "could not start audio");
+}
+
+int
+getAudioBufferSize()
+{
+	return (par.appbufsz * par.bps * par.pchan);
+}
+
+
+void
+mixerSetVolume(int leftVolume, int rightVolume)
+{
+	/* values from 0..100 */
+}
+
+int
+mixerOpen()
+{
+	return false;
+}
+
+void
 ** Diff limit reached (max: 250 lines) **
ebafa74d 2014-11-26 12:51:15 François Andriot
Enable pthread support in mpeglib on openbsd

Signed-off-by: François Andriot <francois.andriot@...>
M mpeglib/configure.in.in
 ** Diff limit reached (max: 250 lines) **
7e00eb19 2014-11-26 12:52:12 François Andriot
Fix arts detection
Add sndio detection

Signed-off-by: François Andriot <francois.andriot@...>
M configure.in.in
 ** Diff limit reached (max: 250 lines) **
e2de1ffe 2014-11-26 12:53:11 François Andriot
Fix link flags in mpeglib/lib

Signed-off-by: François Andriot <francois.andriot@...>
M mpeglib/lib/util/audio/Makefile.am
 ** Diff limit reached (max: 250 lines) **