summaryrefslogtreecommitdiff
path: root/src/player.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-09-23 10:19:58 +0200
committerLars-Dominik Braun <lars@6xq.net>2018-09-23 10:19:58 +0200
commitd0cdce3646189775b3bd6f884669cad509201902 (patch)
tree5badad621f1f05708babada736738b5ac5622747 /src/player.c
parentbbbdd99fdaacfe0a3c9a1237fa0d086907c1286f (diff)
downloadpianobar-d0cdce3646189775b3bd6f884669cad509201902.tar.gz
pianobar-d0cdce3646189775b3bd6f884669cad509201902.tar.bz2
pianobar-d0cdce3646189775b3bd6f884669cad509201902.zip
Don’t use deprecated ffmpeg functions
These are now optional according to doc/APIchanges. Closes #670.
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/player.c b/src/player.c
index ff1f1c9..16f5553 100644
--- a/src/player.c
+++ b/src/player.c
@@ -70,16 +70,19 @@ static void printError (const BarSettings_t * const settings,
}
/* global initialization
- *
- * XXX: in theory we can select the filters/formats we want to support, but
- * this does not work in practise.
*/
void BarPlayerInit (player_t * const p, const BarSettings_t * const settings) {
ao_initialize ();
av_log_set_level (AV_LOG_FATAL);
+#ifdef HAVE_AV_REGISTER_ALL
av_register_all ();
+#endif
+#ifdef HAVE_AVFILTER_REGISTER_ALL
avfilter_register_all ();
+#endif
+#ifdef HAVE_AVFORMAT_NETWORK_INIT
avformat_network_init ();
+#endif
pthread_mutex_init (&p->lock, NULL);
pthread_cond_init (&p->cond, NULL);
@@ -95,7 +98,9 @@ void BarPlayerDestroy (player_t * const p) {
pthread_cond_destroy (&p->aoplayCond);
pthread_mutex_destroy (&p->aoplayLock);
+#ifdef HAVE_AVFORMAT_NETWORK_INIT
avformat_network_deinit ();
+#endif
ao_shutdown ();
}