54 lines
2.1 KiB
Plaintext
54 lines
2.1 KiB
Plaintext
$OpenBSD: patch-src_support_c,v 1.8 2012/05/03 15:19:08 dcoppa Exp $
|
|
|
|
Fix format string: missing format argument
|
|
(upstream svn revision r2246)
|
|
|
|
Don't update cover art when URL call fails
|
|
(upstream svn revision r2241)
|
|
|
|
--- src/support.c.orig Tue Feb 21 19:04:44 2012
|
|
+++ src/support.c Thu May 3 15:06:04 2012
|
|
@@ -885,7 +885,7 @@ gint parse_vcd(gchar * filename)
|
|
|
|
if (error_msg != NULL) {
|
|
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
|
|
- GTK_BUTTONS_CLOSE, error_msg);
|
|
+ GTK_BUTTONS_CLOSE, "%s", error_msg);
|
|
gtk_window_set_title(GTK_WINDOW(dialog), _("GNOME MPlayer Error"));
|
|
gtk_dialog_run(GTK_DIALOG(dialog));
|
|
gtk_widget_destroy(dialog);
|
|
@@ -2414,6 +2414,7 @@ gpointer get_cover_art(gpointer data)
|
|
gboolean local_artist = FALSE;
|
|
gboolean local_album = FALSE;
|
|
CURL *curl;
|
|
+ CURLcode result;
|
|
FILE *art;
|
|
gpointer pixbuf;
|
|
MetaData *metadata = (MetaData *) data;
|
|
@@ -2555,19 +2556,24 @@ gpointer get_cover_art(gpointer data)
|
|
g_mkdir_with_parents(path, 0775);
|
|
}
|
|
|
|
+ result = 0;
|
|
art = fopen(cache_file, "wb");
|
|
if (art) {
|
|
curl = curl_easy_init();
|
|
if (curl) {
|
|
curl_easy_setopt(curl, CURLOPT_URL, url);
|
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, art);
|
|
- curl_easy_perform(curl);
|
|
+ result = curl_easy_perform(curl);
|
|
curl_easy_cleanup(curl);
|
|
}
|
|
fclose(art);
|
|
}
|
|
// printf("cover art url is %s\n",url);
|
|
g_free(url);
|
|
+ if (result != 0) {
|
|
+ g_free(cache_file);
|
|
+ cache_file = NULL;
|
|
+ }
|
|
}
|
|
}
|
|
}
|