diff options
Diffstat (limited to 'src/input/ffmpeg_input_plugin.c')
-rw-r--r-- | src/input/ffmpeg_input_plugin.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/input/ffmpeg_input_plugin.c b/src/input/ffmpeg_input_plugin.c index 8ff66c5b4..d71b3d4c0 100644 --- a/src/input/ffmpeg_input_plugin.c +++ b/src/input/ffmpeg_input_plugin.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2010 The Music Player Daemon Project + * Copyright (C) 2003-2011 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -19,15 +19,11 @@ #include "config.h" #include "input/ffmpeg_input_plugin.h" +#include "input_internal.h" #include "input_plugin.h" -#ifdef OLD_FFMPEG_INCLUDES -#include <avio.h> -#include <avformat.h> -#else #include <libavformat/avio.h> #include <libavformat/avformat.h> -#endif #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "input_ffmpeg" @@ -71,20 +67,20 @@ input_ffmpeg_init(G_GNUC_UNUSED const struct config_param *param, { av_register_all(); -#if LIBAVFORMAT_VERSION_MAJOR >= 52 /* disable this plugin if there's no registered protocol */ if (!input_ffmpeg_supported()) { g_set_error(error_r, ffmpeg_quark(), 0, "No protocol"); return false; } -#endif return true; } static struct input_stream * -input_ffmpeg_open(const char *uri, GError **error_r) +input_ffmpeg_open(const char *uri, + GMutex *mutex, GCond *cond, + GError **error_r) { struct input_ffmpeg *i; @@ -97,10 +93,13 @@ input_ffmpeg_open(const char *uri, GError **error_r) return NULL; i = g_new(struct input_ffmpeg, 1); - input_stream_init(&i->base, &input_plugin_ffmpeg, uri); + input_stream_init(&i->base, &input_plugin_ffmpeg, uri, + mutex, cond); -#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,0,0) +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,1,0) int ret = avio_open(&i->h, uri, AVIO_FLAG_READ); +#elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,0,0) + int ret = avio_open(&i->h, uri, AVIO_RDONLY); #else int ret = url_open(&i->h, uri, URL_RDONLY); #endif |