aboutsummaryrefslogtreecommitdiffstats
path: root/mpd-notification.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-10-07 11:21:41 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-10-07 11:21:41 +0200
commit8873dbcb1f41fcf5cf2778e3ad984bbef2dc1a4d (patch)
treee7072fc4538ef69192d31f486f2834cd9052d9fa /mpd-notification.c
parent45aab0abd78e97411a76c2d6932286a99f7db4d8 (diff)
downloadmpd-notification-8873dbcb1f41fcf5cf2778e3ad984bbef2dc1a4d.tar.gz
mpd-notification-8873dbcb1f41fcf5cf2778e3ad984bbef2dc1a4d.tar.zst
fix compilation without libav
Diffstat (limited to 'mpd-notification.c')
-rw-r--r--mpd-notification.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mpd-notification.c b/mpd-notification.c
index a8fe512..beaee98 100644
--- a/mpd-notification.c
+++ b/mpd-notification.c
@@ -159,12 +159,14 @@ image:
regfree(&regex);
closedir(dir);
-done:
fail:
+#ifdef HAVE_LIBAV
+done:
if (pFormatCtx != NULL) {
avformat_close_input(&pFormatCtx);
avformat_free_context(pFormatCtx);
}
+#endif
free(uri_path);
@@ -333,7 +335,7 @@ int main(int argc, char ** argv) {
goto out30;
}
- if(notify_init(PROGNAME) == FALSE) {
+ if (notify_init(PROGNAME) == FALSE) {
fprintf(stderr, "%s: Can't create notify.\n", program);
goto out20;
}
@@ -352,7 +354,7 @@ int main(int argc, char ** argv) {
signal(SIGTERM, received_signal);
signal(SIGUSR1, received_signal);
- while(doexit == 0 && mpd_run_idle_mask(conn, MPD_IDLE_PLAYER)) {
+ while (doexit == 0 && mpd_run_idle_mask(conn, MPD_IDLE_PLAYER)) {
mpd_command_list_begin(conn, true);
mpd_send_status(conn);
mpd_send_current_song(conn);
@@ -479,13 +481,13 @@ out20:
if (conn != NULL)
mpd_connection_free(conn);
-#ifdef HAVE_LIBAV
out30:
+#ifdef HAVE_LIBAV
if (magic != NULL)
magic_close(magic);
+out40:
#endif
-out40:
if (ini != NULL)
iniparser_freedict(ini);