diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2014-06-02 12:40:56 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2014-06-02 13:01:32 +0200 |
commit | 0a64272db65201fc2ecb3406b89d895966933b99 (patch) | |
tree | 6b0d5ce6ac9ba9aaa0c398353d7e5a83922eeed9 /src | |
parent | 947b381fb63711fab30f7212638ef792f5aa2a3f (diff) | |
download | pianobar-0a64272db65201fc2ecb3406b89d895966933b99.tar.gz pianobar-0a64272db65201fc2ecb3406b89d895966933b99.tar.bz2 pianobar-0a64272db65201fc2ecb3406b89d895966933b99.zip |
libav* autodetection
I’ll give it another shot. ffmpeg’s doc/developer.texi states their
micro version always starts at 100 for this very reason. Use that to
detect ffmpeg and guess its version by looking at major and minor
version numbers. Let’s hope this works.
Diffstat (limited to 'src')
-rw-r--r-- | src/player.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/player.c b/src/player.c index b82a3aa..fba1d47 100644 --- a/src/player.c +++ b/src/player.c @@ -31,6 +31,26 @@ THE SOFTWARE. #include <assert.h> #include <arpa/inet.h> +/* ffmpeg/libav quirks + * ffmpeg’s micro versions always start at 100, that’s how we can distinguish + * ffmpeg and libav */ +#include <libavfilter/version.h> +/* ffmpeg 2.2 */ +#if LIBAVFILTER_VERSION_MAJOR == 4 && \ + LIBAVFILTER_VERSION_MINOR <= 2 && \ + LIBAVFILTER_VERSION_MICRO >= 100 +#define HAVE_AVFILTER_GRAPH_SEND_COMMAND +#endif + +/* ffmpeg 1.2 */ +#if LIBAVFILTER_VERSION_MAJOR == 3 && \ + LIBAVFILTER_VERSION_MINOR <= 42 && \ + LIBAVFILTER_VERSION_MINOR > 32 && \ + LIBAVFILTER_VERSION_MICRO >= 100 +#define HAVE_AV_BUFFERSINK_GET_BUFFER_REF +#define HAVE_LIBAVFILTER_AVCODEC_H +#endif + #include <ao/ao.h> #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> |