summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2014-04-11 19:20:58 +0200
committerLars-Dominik Braun <lars@6xq.net>2014-04-11 19:20:58 +0200
commit0ba07406f7348605d82373bf43d43099033c9447 (patch)
tree87a0fc04dc97c9e0b572bb6b4808efec2235e95f
parent8012d6cb4bb65a858105ef878c5b98d91b24e1cd (diff)
downloadpianobar-0ba07406f7348605d82373bf43d43099033c9447.tar.gz
pianobar-0ba07406f7348605d82373bf43d43099033c9447.tar.bz2
pianobar-0ba07406f7348605d82373bf43d43099033c9447.zip
Fix volume control
Commit 8012d6cb4bb65a858105ef878c5b98d91b24e1cd was broken in several ways. Since auto-detection did not work correctly it was replaced by a user-editable variable. See #439.
-rw-r--r--INSTALL2
-rw-r--r--Makefile52
-rw-r--r--src/player.c2
3 files changed, 19 insertions, 37 deletions
diff --git a/INSTALL b/INSTALL
index f3db418..4940979 100644
--- a/INSTALL
+++ b/INSTALL
@@ -16,7 +16,7 @@ Dependencies
Building
--------
-If you have all of the dependencies listed above just type
+Edit the Makefile and then type
gmake clean && gmake
diff --git a/Makefile b/Makefile
index 53b5cb0..a73e409 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,9 @@ LIBDIR:=${PREFIX}/lib
INCDIR:=${PREFIX}/include
MANDIR:=${PREFIX}/share/man
DYNLINK:=0
+# choose your libav implementation.
+# supported: ffmpeg2.2, ffmpeg2.1, ffmpeg1.2, libav10, libav9
+LIBAV:=undefined
# Respect environment variables set by user; does not work with :=
ifeq (${CFLAGS},)
@@ -85,24 +88,20 @@ LIBGCRYPT_LDFLAGS:=-lgcrypt
LIBJSONC_CFLAGS:=$(shell pkg-config --cflags json-c 2>/dev/null || pkg-config --cflags json)
LIBJSONC_LDFLAGS:=$(shell pkg-config --libs json-c 2>/dev/null || pkg-config --libs json)
-# simple feature testing
-define TEST_AV_BUFFERSINK_GET_BUFFER_REF
-#include <libavfilter/buffersink.h>\n
-int main() {
- void *foo = av_buffersink_get_buffer_ref;
-}
-endef
-
-define TEST_AVFILTER_GRAPH_SEND_COMMAND
-#include <libavfilter/avfiltergraph.h>\n
-int main() {
- void *foo = avfilter_graph_send_command;
-}
-endef
-
-EXTRA_CFLAGS:=\
- $(shell echo -e "${TEST_AV_BUFFERSINK_GET_BUFFER_REF}" | ${CC} ${LIBAV_CFLAGS} ${LIBAV_LDFLAGS} -x c -c -o /dev/null - 2>/dev/null && echo "-DHAVE_AV_BUFFERSINK_GET_BUFFER_REF") \
- $(shell echo -e "${TEST_AVFILTER_GRAPH_SEND_COMMAND}" | ${CC} ${LIBAV_CFLAGS} ${LIBAV_LDFLAGS} -x c -c -o /dev/null - 2>/dev/null && echo "-DHAVE_AVFILTER_GRAPH_SEND_COMMAND")
+# libav* quirks
+ifeq (${LIBAV}, ffmpeg2.2)
+EXTRA_CFLAGS:=-DHAVE_AVFILTER_GRAPH_SEND_COMMAND
+else ifeq (${LIBAV}, ffmpeg2.1)
+EXTRA_CFLAGS:=
+else ifeq (${LIBAV}, ffmpeg1.2)
+EXTRA_CFLAGS:=-DHAVE_AV_BUFFERSINK_GET_BUFFER_REF
+else ifeq (${LIBAV}, libav10)
+EXTRA_CFLAGS:=
+else ifeq (${LIBAV}, libav9)
+EXTRA_CFLAGS:=
+else
+$(error Please choose a valid libav implementation by setting LIBAV)
+endif
# combine all flags
ALL_CFLAGS:=${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
@@ -167,23 +166,6 @@ clean:
all: pianobar
-debug: pianobar
-debug: CC=clang
-debug: CFLAGS=-g -Wall -Wextra \
- -pedantic \
- -Wno-unused-parameter \
- -fsanitize=integer \
- -fsanitize=undefined \
- -fsanitize=alignment \
- -fsanitize=bool \
- -fsanitize=bounds \
- -fsanitize=enum \
- -fsanitize=shift \
- -fsanitize=signed-integer-overflow \
- -fsanitize=unsigned-integer-overflow \
- -fno-sanitize-recover
-debug: LDFLAGS=$(CFLAGS)
-
waitress-test: ${LIBWAITRESS_TEST_OBJ}
${CC} ${LDFLAGS} ${LIBWAITRESS_TEST_OBJ} ${LIBGNUTLS_LDFLAGS} -o waitress-test
diff --git a/src/player.c b/src/player.c
index f3d9838..34573d7 100644
--- a/src/player.c
+++ b/src/player.c
@@ -288,7 +288,7 @@ void *BarPlayerThread (void *data) {
while (true) {
AVFilterBufferRef *audioref = NULL;
-#ifdef TEST_AV_BUFFERSINK_GET_BUFFER_REF
+#ifdef HAVE_AV_BUFFERSINK_GET_BUFFER_REF
/* ffmpeg’s compatibility layer is broken in some releases */
if (av_buffersink_get_buffer_ref (fbufsink, &audioref, 0) < 0) {
#else