[Mplayerplug-in-cvs] mplayerplug-in/Source plugin-ui.cpp,1.207,1.208
Brought to you by:
kdekorte
From: Kevin D. <kde...@us...> - 2006-03-22 20:57:25
|
Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8277/Source Modified Files: plugin-ui.cpp Log Message: Add support in srcToButton if original src is a jpeg or bitmap..etc Index: plugin-ui.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-ui.cpp,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** plugin-ui.cpp 16 Mar 2006 16:18:26 -0000 1.207 --- plugin-ui.cpp 22 Mar 2006 20:57:21 -0000 1.208 *************** *** 2897,2902 **** GError *error = NULL; int exit_status; ! gchar *dirname; ! gchar *filename; gboolean result; GtkWidget *fixed_button_container; --- 2897,2902 ---- GError *error = NULL; int exit_status; ! gchar *dirname = NULL; ! gchar *filename = NULL; gboolean result; GtkWidget *fixed_button_container; *************** *** 2905,2927 **** printf("In srcToButton\n"); ! // setup tmp directory ! dirname = ! g_strdup_printf("%s", tempnam("/tmp", "mplayerplug-inXXXXXX")); ! filename = g_strdup_printf("%s/00000001.jpg", dirname); ! ! // run mplayer and try to get the first frame and convert it to a jpeg ! command = ! g_strdup_printf("mplayer -vo jpeg:outdir=%s -frames 1 %s", ! dirname, url); ! if (!g_spawn_command_line_sync ! (command, NULL, NULL, &exit_status, &error)) ! printf("Error when running When running command: %s\n%s\n", ! command, error->message); ! ! if (fexists(filename)) { ! instance->pb_src = gdk_pixbuf_new_from_file(filename, &error); ! } else { ! instance->pb_src = ! gdk_pixbuf_new_from_xpm_data((const char **) start); } if (instance->pb_src != NULL) { --- 2905,2934 ---- printf("In srcToButton\n"); ! // try to load the file natively ! instance->pb_src = gdk_pixbuf_new_from_file(url, &error); ! ! if (instance->pb_src == NULL) { ! // setup tmp directory ! dirname = ! g_strdup_printf("%s", tempnam("/tmp", "mplayerplug-inXXXXXX")); ! filename = g_strdup_printf("%s/00000001.jpg", dirname); ! ! // run mplayer and try to get the first frame and convert it to a jpeg ! command = ! g_strdup_printf("mplayer -vo jpeg:outdir=%s -frames 1 %s", ! dirname, url); ! if (!g_spawn_command_line_sync ! (command, NULL, NULL, &exit_status, &error)) ! printf("Error when running When running command: %s\n%s\n", ! command, error->message); ! ! if (fexists(filename)) { ! error = NULL; ! instance->pb_src = gdk_pixbuf_new_from_file(filename, &error); ! } else { ! instance->pb_src = ! gdk_pixbuf_new_from_xpm_data((const char **) start); ! } ! } if (instance->pb_src != NULL) { |