summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/alsa/alsa.c15
-rw-r--r--plugins/ffap/ffap.c2
-rw-r--r--plugins/ffmpeg/ffmpeg.c5
-rw-r--r--plugins/nullout/nullout.c4
-rw-r--r--plugins/sid/csid.cpp4
5 files changed, 22 insertions, 8 deletions
diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c
index 9d6e35d8..e4c6f584 100644
--- a/plugins/alsa/alsa.c
+++ b/plugins/alsa/alsa.c
@@ -29,6 +29,9 @@
static DB_output_t plugin;
DB_functions_t *deadbeef;
+#define BUFFER_MIN 1024
+#define BUFFER_MAX 4096
+
static snd_pcm_t *audio;
static int bufsize = -1;
static int alsa_terminate;
@@ -474,13 +477,13 @@ palsa_thread (void *context) {
/* deliver the data */
// FIXME: under some conditions, frames_to_deliver may become huge
// like 20M. this case is not handled here.
- if (frames_to_deliver < 1024) {
- trace ("alsa: frames_to_deliver clipped from %d to 1024\n", frames_to_deliver);
- frames_to_deliver = 1024;
+ if (frames_to_deliver < BUFFER_MIN) {
+ trace ("alsa: frames_to_deliver clipped from %d to %d\n", frames_to_deliver, BUFFER_MIN);
+ frames_to_deliver = BUFFER_MIN;
}
- else if (frames_to_deliver > 2048) {
- trace ("alsa: frames_to_deliver clipped from %d to 2048\n", frames_to_deliver);
- frames_to_deliver = 2048;
+ else if (frames_to_deliver > BUFFER_MAX) {
+ trace ("alsa: frames_to_deliver clipped from %d to %d\n", frames_to_deliver, BUFFER_MAX);
+ frames_to_deliver = BUFFER_MAX;
}
char buf[frames_to_deliver*4];
palsa_callback (buf, frames_to_deliver*4);
diff --git a/plugins/ffap/ffap.c b/plugins/ffap/ffap.c
index 6a18ec35..0a4e3276 100644
--- a/plugins/ffap/ffap.c
+++ b/plugins/ffap/ffap.c
@@ -33,7 +33,7 @@
#include <string.h>
#include <limits.h>
#include <stdlib.h>
-#include <alloca.h>
+//#include <alloca.h>
#include <assert.h>
#include "../../deadbeef.h"
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
index fdfaf840..0aa91527 100644
--- a/plugins/ffmpeg/ffmpeg.c
+++ b/plugins/ffmpeg/ffmpeg.c
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <alloca.h>
+//#include <alloca.h>
#include <errno.h>
#include "../../deadbeef.h"
@@ -39,7 +39,10 @@
#include <ffmpeg/avutil.h>
#include <ffmpeg/avstring.h>
#define AVERROR_EOF AVERROR(EPIPE)
+
+#if LIBAVFORMAT_VERSION_MAJOR < 53
#define av_register_protocol register_protocol
+#endif
#endif
diff --git a/plugins/nullout/nullout.c b/plugins/nullout/nullout.c
index e8da5255..8720de6d 100644
--- a/plugins/nullout/nullout.c
+++ b/plugins/nullout/nullout.c
@@ -17,7 +17,9 @@
*/
#include <stdint.h>
#include <unistd.h>
+#ifdef __linux__
#include <sys/prctl.h>
+#endif
#include <stdio.h>
#include <string.h>
#include "../../deadbeef.h"
@@ -164,7 +166,9 @@ pnull_get_endianness (void) {
static void
pnull_thread (void *context) {
+#ifdef __linux__
prctl (PR_SET_NAME, "deadbeef-null", 0, 0, 0, 0);
+#endif
for (;;) {
if (null_terminate) {
break;
diff --git a/plugins/sid/csid.cpp b/plugins/sid/csid.cpp
index bb0d4655..74d3423f 100644
--- a/plugins/sid/csid.cpp
+++ b/plugins/sid/csid.cpp
@@ -406,7 +406,11 @@ convstr (const char* str) {
else {
size_t inbytesleft = sz;
size_t outbytesleft = 2047;
+#ifdef __linux__
char *pin = (char*)str;
+#else
+ const char *pin = str;
+#endif
char *pout = out;
memset (out, 0, sizeof (out));
size_t res = iconv (cd, &pin, &inbytesleft, &pout, &outbytesleft);