aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-07-14 18:27:49 +0200
committerGravatar Christian Hesse <mail@eworm.de>2015-07-14 18:27:49 +0200
commite4f8c1f447c40905fa3bdf562dc10dcdf3422ed9 (patch)
tree1eb960ff3963473afb9e687d7317de072ea55e1b
parent14c059a73c62c8e25d8d80d7ae7edeb0380fb20c (diff)
downloadmpd-notification-e4f8c1f447c40905fa3bdf562dc10dcdf3422ed9.tar.gz
mpd-notification-e4f8c1f447c40905fa3bdf562dc10dcdf3422ed9.tar.zst
clean AVFormatContext
-rw-r--r--mpd-notification.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mpd-notification.c b/mpd-notification.c
index 0bfa252..bf4ebc9 100644
--- a/mpd-notification.c
+++ b/mpd-notification.c
@@ -61,7 +61,7 @@ void received_signal(int signal) {
GdkPixbuf * retrieve_album_art(const char * music_dir, const char * uri) {
int i;
AVPacket pkt;
- AVFormatContext * pFormatCtx = NULL;
+ AVFormatContext * pFormatCtx;
GdkPixbufLoader * loader;
GdkPixbuf * pixbuf = NULL;
char * uri_path = NULL;
@@ -101,12 +101,12 @@ GdkPixbuf * retrieve_album_art(const char * music_dir, const char * uri) {
}
fail:
+ avformat_close_input(&pFormatCtx);
+ avformat_free_context(pFormatCtx);
+
if (uri_path)
free(uri_path);
- if (pFormatCtx)
- avformat_free_context(pFormatCtx);
-
return pixbuf;
}
#endif