Commit cce286bf authored by Philip Withnall's avatar Philip Withnall

Fixed some strict gcc warnings

2009-07-18  Philip Withnall  <philip@tecnocode.co.uk>

	* src/backend/bacon-resize.c (bacon_resize_resize),
	(bacon_resize_restore):
	* src/backend/bacon-video-widget-gst-0.10.c
	(bacon_video_widget_open), (bacon_video_widget_seek_time),
	(bacon_video_widget_set_logo):
	* src/backend/bacon-video-widget.h:
	* src/backend/bvw-test.c (test_bvw_set_mrl), (on_redirect),
	(on_eos_event), (main):
	* src/backend/video-utils.c (totem_time_to_string),
	(totem_time_to_string_text):
	* src/plugins/brasero-disc-recorder/totem-disc-recorder.c
	(totem_disc_recorder_plugin_start_burning):
	* src/plugins/properties/bacon-video-widget-properties.c
	(bacon_video_widget_properties_from_time):
	* src/plugins/properties/bacon-video-widget-properties.h:
	* src/plugins/publish/totem-publish.c
	(totem_publish_plugin_playlist_cb):
	* src/plugins/screenshot/totem-gallery.c
	(dialog_response_callback):
	* src/plugins/screenshot/totem-screenshot.c (drag_data_get):
	* src/plugins/skipto/totem-skipto-plugin.c
	(totem_skipto_update_from_state):
	* src/plugins/skipto/totem-skipto.c (totem_skipto_update_range),
	(totem_skipto_get_range), (totem_skipto_set_current):
	* src/plugins/skipto/totem-skipto.h:
	* src/plugins/totem-plugins-engine.c (load_plugin_module),
	(totem_plugins_engine_plugin_active_cb),
	(totem_plugins_engine_plugin_visible_cb):
	* src/plugins/youtube/totem-youtube.c (starting_video_cb):
	* src/totem-menu.c (add_lang_action), (totem_action_add_recent):
	* src/totem-object.c (totem_get_title_at_playlist_pos),
	(totem_action_load_media), (window_state_event_cb),
	(totem_action_set_mrl_with_warning), (totem_time_within_seconds),
	(totem_seek_time_rel), (drop_video_cb), (drag_motion_video_cb),
	(drop_playlist_cb), (drag_motion_playlist_cb), (drag_video_cb),
	(seek_slider_changed_cb), (totem_action_set_playlist_index),
	(totem_action_remote), (totem_action_handle_key_release),
	(window_key_press_event_cb):
	* src/totem-options.c (totem_options_process_late):
	* src/totem-options.h:
	* src/totem-playlist.c (drop_cb), (playlist_show_popup_menu),
	(totem_playlist_set_reorderable),
	(totem_playlist_clear_with_compare), (totem_playlist_get_title),
	(totem_playlist_get_current), (totem_playlist_set_current):
	* src/totem-playlist.h:
	* src/totem-preferences.c (totem_setup_preferences):
	* src/totem-private.h:
	* src/totem-session.c (totem_save_state_cb):
	* src/totem-statusbar.c (totem_statusbar_update_time),
	(totem_statusbar_set_time), (totem_statusbar_set_time_and_length):
	* src/totem-subtitle-encoding.c (subtitle_encoding_get_charset),
	(subtitle_encoding_create_store),
	(totem_subtitle_encoding_get_selected),
	(totem_subtitle_encoding_set):
	* src/totem-time-label.c (totem_time_label_init),
	(totem_time_label_set_time):
	* src/totem-video-thumbnailer.c (create_gallery), (main):
	* src/totem.c (totem_message_received_cb), (main):
	* src/totem.h: Fixed some strict gcc warnings.
parent f53e438e
2009-07-18 Philip Withnall <philip@tecnocode.co.uk>
* src/backend/bacon-resize.c (bacon_resize_resize),
(bacon_resize_restore):
* src/backend/bacon-video-widget-gst-0.10.c
(bacon_video_widget_open), (bacon_video_widget_seek_time),
(bacon_video_widget_set_logo):
* src/backend/bacon-video-widget.h:
* src/backend/bvw-test.c (test_bvw_set_mrl), (on_redirect),
(on_eos_event), (main):
* src/backend/video-utils.c (totem_time_to_string),
(totem_time_to_string_text):
* src/plugins/brasero-disc-recorder/totem-disc-recorder.c
(totem_disc_recorder_plugin_start_burning):
* src/plugins/properties/bacon-video-widget-properties.c
(bacon_video_widget_properties_from_time):
* src/plugins/properties/bacon-video-widget-properties.h:
* src/plugins/publish/totem-publish.c
(totem_publish_plugin_playlist_cb):
* src/plugins/screenshot/totem-gallery.c
(dialog_response_callback):
* src/plugins/screenshot/totem-screenshot.c (drag_data_get):
* src/plugins/skipto/totem-skipto-plugin.c
(totem_skipto_update_from_state):
* src/plugins/skipto/totem-skipto.c (totem_skipto_update_range),
(totem_skipto_get_range), (totem_skipto_set_current):
* src/plugins/skipto/totem-skipto.h:
* src/plugins/totem-plugins-engine.c (load_plugin_module),
(totem_plugins_engine_plugin_active_cb),
(totem_plugins_engine_plugin_visible_cb):
* src/plugins/youtube/totem-youtube.c (starting_video_cb):
* src/totem-menu.c (add_lang_action), (totem_action_add_recent):
* src/totem-object.c (totem_get_title_at_playlist_pos),
(totem_action_load_media), (window_state_event_cb),
(totem_action_set_mrl_with_warning), (totem_time_within_seconds),
(totem_seek_time_rel), (drop_video_cb), (drag_motion_video_cb),
(drop_playlist_cb), (drag_motion_playlist_cb), (drag_video_cb),
(seek_slider_changed_cb), (totem_action_set_playlist_index),
(totem_action_remote), (totem_action_handle_key_release),
(window_key_press_event_cb):
* src/totem-options.c (totem_options_process_late):
* src/totem-options.h:
* src/totem-playlist.c (drop_cb), (playlist_show_popup_menu),
(totem_playlist_set_reorderable),
(totem_playlist_clear_with_compare), (totem_playlist_get_title),
(totem_playlist_get_current), (totem_playlist_set_current):
* src/totem-playlist.h:
* src/totem-preferences.c (totem_setup_preferences):
* src/totem-private.h:
* src/totem-session.c (totem_save_state_cb):
* src/totem-statusbar.c (totem_statusbar_update_time),
(totem_statusbar_set_time), (totem_statusbar_set_time_and_length):
* src/totem-subtitle-encoding.c (subtitle_encoding_get_charset),
(subtitle_encoding_create_store),
(totem_subtitle_encoding_get_selected),
(totem_subtitle_encoding_set):
* src/totem-time-label.c (totem_time_label_init),
(totem_time_label_set_time):
* src/totem-video-thumbnailer.c (create_gallery), (main):
* src/totem.c (totem_message_received_cb), (main):
* src/totem.h: Fixed some strict gcc warnings.
2009-07-18 Robin Stocker <robin@nibor.org>
* src/totem-object.c (drop_video_cb, drop_playlist_cb):
......
......@@ -218,16 +218,16 @@ bacon_resize_resize (BaconResize *resize)
gboolean found = FALSE;
GdkWindow *root;
GdkScreen *screen;
Display *Display;
Display *xdisplay;
g_return_if_fail (GTK_IS_WIDGET (resize->priv->video_widget));
g_return_if_fail (GTK_WIDGET_REALIZED (resize->priv->video_widget));
Display = GDK_DRAWABLE_XDISPLAY (resize->priv->video_widget->window);
if (Display == NULL)
xdisplay = GDK_DRAWABLE_XDISPLAY (resize->priv->video_widget->window);
if (xdisplay == NULL)
return;
XLockDisplay (Display);
XLockDisplay (xdisplay);
screen = gtk_widget_get_screen (resize->priv->video_widget);
root = gdk_screen_get_root_window (screen);
......@@ -236,7 +236,7 @@ bacon_resize_resize (BaconResize *resize)
if (gdk_screen_get_n_monitors (screen) > 1)
goto bail;
res = XF86VidModeGetModeLine (Display, GDK_SCREEN_XNUMBER (screen), &dotclock, &modeline);
res = XF86VidModeGetModeLine (xdisplay, GDK_SCREEN_XNUMBER (screen), &dotclock, &modeline);
if (!res)
goto bail;
......@@ -250,7 +250,7 @@ bacon_resize_resize (BaconResize *resize)
gdk_error_trap_push ();
/* Find the XRandR mode that corresponds to the real size */
resize->priv->xr_screen_conf = XRRGetScreenInfo (Display, GDK_WINDOW_XWINDOW (root));
resize->priv->xr_screen_conf = XRRGetScreenInfo (xdisplay, GDK_WINDOW_XWINDOW (root));
xr_sizes = XRRConfigSizes (resize->priv->xr_screen_conf, &xr_nsize);
resize->priv->xr_original_size = XRRConfigCurrentConfiguration (resize->priv->xr_screen_conf, &(resize->priv->xr_current_rotation));
if (gdk_error_trap_pop ()) {
......@@ -269,7 +269,7 @@ bacon_resize_resize (BaconResize *resize)
goto bail;
gdk_error_trap_push ();
XRRSetScreenConfig (Display,
XRRSetScreenConfig (xdisplay,
resize->priv->xr_screen_conf,
GDK_WINDOW_XWINDOW (root),
(SizeID) i,
......@@ -282,7 +282,7 @@ bacon_resize_resize (BaconResize *resize)
resize->priv->resized = TRUE;
bail:
XUnlockDisplay (Display);
XUnlockDisplay (xdisplay);
#endif /* HAVE_XVIDMODE */
}
......@@ -294,7 +294,7 @@ bacon_resize_restore (BaconResize *resize)
XF86VidModeModeLine modeline;
GdkWindow *root;
GdkScreen *screen;
Display *Display;
Display *xdisplay;
g_return_if_fail (GTK_IS_WIDGET (resize->priv->video_widget));
g_return_if_fail (GTK_WIDGET_REALIZED (resize->priv->video_widget));
......@@ -304,15 +304,15 @@ bacon_resize_restore (BaconResize *resize)
if (resize->priv->xr_screen_conf == NULL)
return;
Display = GDK_DRAWABLE_XDISPLAY (resize->priv->video_widget->window);
if (Display == NULL)
xdisplay = GDK_DRAWABLE_XDISPLAY (resize->priv->video_widget->window);
if (xdisplay == NULL)
return;
XLockDisplay (Display);
XLockDisplay (xdisplay);
screen = gtk_widget_get_screen (resize->priv->video_widget);
root = gdk_screen_get_root_window (screen);
res = XF86VidModeGetModeLine (Display, GDK_SCREEN_XNUMBER (screen), &dotclock, &modeline);
res = XF86VidModeGetModeLine (xdisplay, GDK_SCREEN_XNUMBER (screen), &dotclock, &modeline);
if (!res)
goto bail;
......@@ -324,7 +324,7 @@ bacon_resize_restore (BaconResize *resize)
goto bail;
gdk_error_trap_push ();
XRRSetScreenConfig (Display,
XRRSetScreenConfig (xdisplay,
resize->priv->xr_screen_conf,
GDK_WINDOW_XWINDOW (root),
resize->priv->xr_original_size,
......@@ -340,7 +340,7 @@ bacon_resize_restore (BaconResize *resize)
resize->priv->xr_screen_conf = NULL;
bail:
XUnlockDisplay (Display);
XUnlockDisplay (xdisplay);
#endif
}
......@@ -91,6 +91,8 @@
(e->domain == GST_##d##_ERROR && \
e->code == GST_##d##_ERROR_##c)
G_DEFINE_TYPE (BaconVideoWidget, bacon_video_widget, GTK_TYPE_EVENT_BOX)
/* Signals */
enum
{
......@@ -3222,16 +3224,16 @@ bacon_video_widget_open (BaconVideoWidget * bvw,
if (g_strrstr (bvw->priv->mrl, "#subtitle:")) {
gchar **uris;
gchar *subtitle_uri;
gchar *new_subtitle_uri;
uris = g_strsplit (bvw->priv->mrl, "#subtitle:", 2);
/* Try to fix subtitle uri if needed */
if (uris[1][0] == '/') {
subtitle_uri = g_strdup_printf ("file://%s", uris[1]);
new_subtitle_uri = g_strdup_printf ("file://%s", uris[1]);
}
else {
if (strchr (uris[1], ':')) {
subtitle_uri = g_strdup (uris[1]);
new_subtitle_uri = g_strdup (uris[1]);
} else {
gchar *cur_dir = g_get_current_dir ();
if (!cur_dir) {
......@@ -3239,13 +3241,13 @@ bacon_video_widget_open (BaconVideoWidget * bvw,
_("Failed to retrieve working directory"));
return FALSE;
}
subtitle_uri = g_strdup_printf ("file://%s/%s", cur_dir, uris[1]);
new_subtitle_uri = g_strdup_printf ("file://%s/%s", cur_dir, uris[1]);
g_free (cur_dir);
}
}
g_object_set (bvw->priv->play, "uri", bvw->priv->mrl,
"suburi", subtitle_uri, NULL);
g_free (subtitle_uri);
"suburi", new_subtitle_uri, NULL);
g_free (new_subtitle_uri);
g_strfreev (uris);
} else {
g_object_set (bvw->priv->play, "uri", bvw->priv->mrl,
......@@ -3401,15 +3403,15 @@ bacon_video_widget_can_direct_seek (BaconVideoWidget *bvw)
* Return value: %TRUE on success, %FALSE otherwise
**/
gboolean
bacon_video_widget_seek_time (BaconVideoWidget *bvw, gint64 time, GError **error)
bacon_video_widget_seek_time (BaconVideoWidget *bvw, gint64 _time, GError **error)
{
g_return_val_if_fail (bvw != NULL, FALSE);
g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (bvw->priv->play), FALSE);
GST_LOG ("Seeking to %" GST_TIME_FORMAT, GST_TIME_ARGS (time * GST_MSECOND));
GST_LOG ("Seeking to %" GST_TIME_FORMAT, GST_TIME_ARGS (_time * GST_MSECOND));
if (time > bvw->priv->stream_length
if (_time > bvw->priv->stream_length
&& bvw->priv->stream_length > 0
&& !g_str_has_prefix (bvw->priv->mrl, "dvd:")
&& !g_str_has_prefix (bvw->priv->mrl, "vcd:")) {
......@@ -3419,11 +3421,11 @@ bacon_video_widget_seek_time (BaconVideoWidget *bvw, gint64 time, GError **error
}
/* Emit a time tick of where we are going, we are paused */
got_time_tick (bvw->priv->play, time * GST_MSECOND, bvw);
got_time_tick (bvw->priv->play, _time * GST_MSECOND, bvw);
gst_element_seek (bvw->priv->play, 1.0,
GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT,
GST_SEEK_TYPE_SET, time * GST_MSECOND,
GST_SEEK_TYPE_SET, _time * GST_MSECOND,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
gst_element_get_state (bvw->priv->play, NULL, NULL, 100 * GST_MSECOND);
......@@ -3665,7 +3667,7 @@ bacon_video_widget_dvd_event (BaconVideoWidget * bvw,
* Sets the logo displayed on the video widget when no stream is loaded.
**/
void
bacon_video_widget_set_logo (BaconVideoWidget * bvw, gchar * filename)
bacon_video_widget_set_logo (BaconVideoWidget * bvw, const gchar * filename)
{
GError *error = NULL;
......@@ -5779,8 +5781,6 @@ cb_gconf (GConfClient * client,
/* */
/* =========================================== */
G_DEFINE_TYPE(BaconVideoWidget, bacon_video_widget, GTK_TYPE_EVENT_BOX)
/* applications must use exactly one of bacon_video_widget_get_option_group()
* OR bacon_video_widget_init_backend(), but not both */
......
......@@ -181,7 +181,7 @@ gboolean bacon_video_widget_seek (BaconVideoWidget *bvw,
double position,
GError **error);
gboolean bacon_video_widget_seek_time (BaconVideoWidget *bvw,
gint64 time,
gint64 _time,
GError **error);
gboolean bacon_video_widget_step (BaconVideoWidget *bvw,
GError **error);
......@@ -201,7 +201,7 @@ double bacon_video_widget_get_volume (BaconVideoWidget *bvw);
/* Properties */
void bacon_video_widget_set_logo (BaconVideoWidget *bvw,
char *filename);
const char *filename);
void bacon_video_widget_set_logo_pixbuf (BaconVideoWidget *bvw,
GdkPixbuf *logo);
void bacon_video_widget_set_logo_mode (BaconVideoWidget *bvw,
......
......@@ -8,31 +8,29 @@
#include <X11/Xlib.h>
#endif
static GtkWidget *win;
static GtkWidget *bvw;
static char *mrl, *argument;
static void
test_bvw_set_mrl (const char *path)
test_bvw_set_mrl (GtkWidget *bvw, const char *path)
{
mrl = g_strdup (path);
bacon_video_widget_open (BACON_VIDEO_WIDGET (bvw), mrl, NULL, NULL);
}
static void
on_redirect (GtkWidget *bvw, const char *mrl, gpointer data)
on_redirect (GtkWidget *bvw, const char *redirect_mrl, gpointer data)
{
g_message ("Redirect to: %s", mrl);
g_message ("Redirect to: %s", redirect_mrl);
}
static void
on_eos_event (GtkWidget *widget, gpointer user_data)
on_eos_event (GtkWidget *bvw, gpointer user_data)
{
bacon_video_widget_stop (BACON_VIDEO_WIDGET (bvw));
bacon_video_widget_close (BACON_VIDEO_WIDGET (bvw));
g_free (mrl);
test_bvw_set_mrl (argument);
test_bvw_set_mrl (bvw, argument);
bacon_video_widget_play (BACON_VIDEO_WIDGET (bvw), NULL);
}
......@@ -73,6 +71,7 @@ error_cb (GtkWidget *bvw, const char *message,
int main
(int argc, char **argv)
{
GtkWidget *win, *bvw;
guint32 height = 500;
guint32 width = 500;
......@@ -112,7 +111,7 @@ int main
gtk_widget_show (bvw);
mrl = NULL;
test_bvw_set_mrl (argv[1] ? argv[1] : LOGO_PATH);
test_bvw_set_mrl (bvw, argv[1] ? argv[1] : LOGO_PATH);
argument = g_strdup (argv[1] ? argv[1] : LOGO_PATH);
bacon_video_widget_play (BACON_VIDEO_WIDGET (bvw), NULL);
gtk_main ();
......
......@@ -71,14 +71,14 @@ totem_display_is_local (void)
char *
totem_time_to_string (gint64 msecs)
{
int sec, min, hour, time;
int sec, min, hour, _time;
time = (int) (msecs / 1000);
sec = time % 60;
time = time - sec;
min = (time % (60*60)) / 60;
time = time - (min * 60);
hour = time / (60*60);
_time = (int) (msecs / 1000);
sec = _time % 60;
_time = _time - sec;
min = (_time % (60*60)) / 60;
_time = _time - (min * 60);
hour = _time / (60*60);
if (hour > 0)
{
......@@ -126,14 +126,14 @@ char *
totem_time_to_string_text (gint64 msecs)
{
char *secs, *mins, *hours, *string;
int sec, min, hour, time;
time = (int) (msecs / 1000);
sec = time % 60;
time = time - sec;
min = (time % (60*60)) / 60;
time = time - (min * 60);
hour = time / (60*60);
int sec, min, hour, _time;
_time = (int) (msecs / 1000);
sec = _time % 60;
_time = _time - sec;
min = (_time % (60*60)) / 60;
_time = _time - (min * 60);
hour = _time / (60*60);
hours = g_strdup_printf (ngettext ("%d hour", "%d hours", hour), hour);
......
......@@ -97,11 +97,11 @@ totem_disc_recorder_plugin_start_burning (TotemDiscRecorderPlugin *pi,
gboolean ret;
array = g_ptr_array_new ();
g_ptr_array_add (array, "brasero");
g_ptr_array_add (array, (gpointer) "brasero");
if (copy != FALSE)
g_ptr_array_add (array, "-c");
g_ptr_array_add (array, (gpointer) "-c");
else
g_ptr_array_add (array, "-r");
g_ptr_array_add (array, (gpointer) "-r");
g_ptr_array_add (array, (gpointer) path);
main_window = totem_get_main_window (pi->totem);
......@@ -109,7 +109,7 @@ totem_disc_recorder_plugin_start_burning (TotemDiscRecorderPlugin *pi,
int xid;
xid = gdk_x11_drawable_get_xid (GDK_DRAWABLE (GTK_WIDGET (main_window)->window));
xid_str = g_strdup_printf ("%d", xid);
g_ptr_array_add (array, "-x");
g_ptr_array_add (array, (gpointer) "-x");
g_ptr_array_add (array, xid_str);
} else {
xid_str = NULL;
......
......@@ -177,21 +177,21 @@ bacon_video_widget_properties_reset (BaconVideoWidgetProperties *props)
void
bacon_video_widget_properties_from_time (BaconVideoWidgetProperties *props,
int time)
int _time)
{
char *string;
g_return_if_fail (props != NULL);
g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
if (time == props->priv->time)
if (_time == props->priv->time)
return;
string = totem_time_to_string_text (time);
string = totem_time_to_string_text (_time);
bacon_video_widget_properties_set_label (props, "duration", string);
g_free (string);
props->priv->time = time;
props->priv->time = _time;
}
void
......
......@@ -51,8 +51,6 @@ void bacon_video_widget_properties_reset (BaconVideoWidgetProperties *props);
void bacon_video_widget_properties_update (BaconVideoWidgetProperties *props,
GtkWidget *bvw);
void bacon_video_widget_properties_from_time (BaconVideoWidgetProperties *props,
int time);
char *bacon_video_widget_properties_time_to_string (int time);
int _time);
#endif /* BACON_VIDEO_WIDGET_PROPERTIES_H */
......@@ -201,14 +201,14 @@ totem_publish_plugin_playlist_cb (EpcPublisher *publisher,
g_slist_length (self->playlist));
for (iter = self->playlist, i = 1; iter; iter = iter->next, ++i) {
gchar *key = iter->data;
gchar *file_key = iter->data;
gchar *uri;
uri = epc_publisher_get_uri (publisher, key, NULL);
uri = epc_publisher_get_uri (publisher, file_key, NULL);
g_string_append_printf (buffer,
"File%d=%s\nTitle%d=%s\n",
i, uri, i, key + 6);
i, uri, i, file_key + 6);
g_free (uri);
}
......
......@@ -148,10 +148,10 @@ dialog_response_callback (GtkDialog *dialog, gint response_id, TotemGallery *sel
totem_screenshot_plugin_update_file_chooser (filename);
/* Build the command and arguments to pass it */
argv[0] = "totem-video-thumbnailer";
argv[1] = "-j"; /* JPEG mode */
argv[2] = "-l"; /* don't limit resources */
argv[3] = "-p"; /* print progress */
argv[0] = (gchar*) "totem-video-thumbnailer"; /* a little hacky, but only the allocated stuff is freed below */
argv[1] = (gchar*) "-j"; /* JPEG mode */
argv[2] = (gchar*) "-l"; /* don't limit resources */
argv[3] = (gchar*) "-p"; /* print progress */
argv[4] = g_strdup_printf ("--gallery=%u", screenshot_count); /* number of screenshots to output */
argv[5] = g_strdup_printf ("--size=%u", gtk_spin_button_get_value_as_int (self->priv->screenshot_width)); /* screenshot width */
argv[6] = video_mrl; /* video to thumbnail */
......
......@@ -91,7 +91,7 @@ drag_data_get (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection_data,
guint info,
guint time,
guint _time,
TotemScreenshot *screenshot)
{
char *string;
......
......@@ -105,18 +105,18 @@ static void
totem_skipto_update_from_state (TotemObject *totem,
TotemSkiptoPlugin *plugin)
{
gint64 time;
gint64 _time;
gboolean seekable;
GtkAction *action;
TotemSkiptoPluginPrivate *priv = plugin->priv;
g_object_get (G_OBJECT (totem),
"stream-length", &time,
"stream-length", &_time,
"seekable", &seekable,
NULL);
if (priv->st != NULL) {
totem_skipto_update_range (priv->st, time);
totem_skipto_update_range (priv->st, _time);
totem_skipto_set_seekable (priv->st, seekable);
}
......
......@@ -100,28 +100,28 @@ totem_skipto_dispose (GObject *object)
}
void
totem_skipto_update_range (TotemSkipto *skipto, gint64 time)
totem_skipto_update_range (TotemSkipto *skipto, gint64 _time)
{
g_return_if_fail (TOTEM_IS_SKIPTO (skipto));
if (time == skipto->priv->time)
if (_time == skipto->priv->time)
return;
gtk_spin_button_set_range (GTK_SPIN_BUTTON (skipto->priv->time_entry),
0, (gdouble) time / 1000);
skipto->priv->time = time;
0, (gdouble) _time / 1000);
skipto->priv->time = _time;
}
gint64
totem_skipto_get_range (TotemSkipto *skipto)
{
gint64 time;
gint64 _time;
g_return_val_if_fail (TOTEM_IS_SKIPTO (skipto), 0);
time = gtk_spin_button_get_value (GTK_SPIN_BUTTON (skipto->priv->time_entry)) * 1000;
_time = gtk_spin_button_get_value (GTK_SPIN_BUTTON (skipto->priv->time_entry)) * 1000;
return time;
return _time;
}
void
......@@ -134,12 +134,12 @@ totem_skipto_set_seekable (TotemSkipto *skipto, gboolean seekable)
}
void
totem_skipto_set_current (TotemSkipto *skipto, gint64 time)
totem_skipto_set_current (TotemSkipto *skipto, gint64 _time)
{
g_return_if_fail (TOTEM_IS_SKIPTO (skipto));
gtk_spin_button_set_value (GTK_SPIN_BUTTON (skipto->priv->time_entry),
(gdouble) (time / 1000));
(gdouble) (_time / 1000));
}
void
......
......@@ -61,9 +61,9 @@ struct TotemSkiptoClass {
GType totem_skipto_get_type (void);
GtkWidget *totem_skipto_new (TotemSkiptoPlugin *plugin);
gint64 totem_skipto_get_range (TotemSkipto *skipto);
void totem_skipto_update_range (TotemSkipto *skipto, gint64 time);
void totem_skipto_update_range (TotemSkipto *skipto, gint64 _time);
void totem_skipto_set_seekable (TotemSkipto *skipto, gboolean seekable);
void totem_skipto_set_current (TotemSkipto *skipto, gint64 time);
void totem_skipto_set_current (TotemSkipto *skipto, gint64 _time);
G_END_DECLS
......
......@@ -528,6 +528,8 @@ load_plugin_module (TotemPluginInfo *info)
g_warning ("Cannot load plugin %s, Python plugin support is disabled", info->location);
#endif
break;
default:
g_assert_not_reached ();
}
if (g_type_module_use (info->module) == FALSE) {
......@@ -548,6 +550,8 @@ load_plugin_module (TotemPluginInfo *info)
info->plugin = TOTEM_PLUGIN (totem_python_module_new_object (TOTEM_PYTHON_MODULE (info->module)));
#endif
break;
default:
g_assert_not_reached ();
}
return TRUE;
......@@ -692,7 +696,7 @@ totem_plugins_engine_configure_plugin (TotemPluginInfo *info,
}
static void
totem_plugins_engine_plugin_active_cb (GConfClient *client,
totem_plugins_engine_plugin_active_cb (GConfClient *gconf_client,
guint cnxn_id,
GConfEntry *entry,
TotemPluginInfo *info)
......@@ -705,7 +709,7 @@ totem_plugins_engine_plugin_active_cb (GConfClient *client,
}
static void
totem_plugins_engine_plugin_visible_cb (GConfClient *client,
totem_plugins_engine_plugin_visible_cb (GConfClient *gconf_client,
guint cnxn_id,
GConfEntry *entry,
TotemPluginInfo *info)
......
......@@ -994,7 +994,6 @@ starting_video_cb (TotemVideoList *video_list, GtkTreePath *path, TotemYouTubePl
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->list_store[self->current_tree_view]), &iter, path) == FALSE)
return FALSE;
gtk_tree_model_get (GTK_TREE_MODEL (self->list_store[self->current_tree_view]), &iter, 3, &video_entry, -1);
g_message ("starting_video_cb: model: %lu, path: %lu, current tv: %u", self->list_store[self->current_tree_view], path, self->current_tree_view);
if (self->playing_video != NULL)
g_object_unref (self->playing_video);
......
......@@ -33,6 +33,7 @@
#include "totem-sidebar.h"
#include "totem-plugin-manager.h"
#include "bacon-video-widget.h"
#include "totem-uri.h"
#include "debug.h"
......@@ -279,7 +280,7 @@ languages_changed_callback (GtkRadioAction *action, GtkRadioAction *current,
static GtkAction *
add_lang_action (Totem *totem, GtkActionGroup *action_group, guint ui_id,
const char **paths, const char *prefix, const char *lang,
int lang_id, int index, GSList **group)
int lang_id, int lang_index, GSList **group)
{
const char *full_lang;
char *label;
......@@ -289,12 +290,12 @@ add_lang_action (Totem *totem, GtkActionGroup *action_group, guint ui_id,
full_lang = totem_lang_get_full (lang);
if (index > 1) {
if (lang_index > 1) {
char *num_lang;
num_lang = g_strdup_printf ("%s #%u",
full_lang ? full_lang : lang,
index);
lang_index);
label = escape_label_for_menu (num_lang);
g_free (num_lang);
} else {
......@@ -709,13 +710,13 @@ totem_action_add_recent (Totem *totem, const char *uri)
data.display_name = NULL;
/* Bogus mime-type, we just want it added */
data.mime_type = g_strdup ("video/x-totem-stream");
groups[0] = "TotemStreams";
groups[0] = (gchar*) "TotemStreams";
g_message ("no file info");
} else {
data.mime_type = g_strdup (g_file_info_get_content_type (file_info));
data.display_name = g_strdup (g_file_info_get_display_name (file_info));
g_object_unref (file_info);
groups[0] = "Totem";
groups[0] = (gchar*) "Totem";
}
g_object_unref (file);
......
......@@ -98,9 +98,10 @@
#define BVW_VBOX_BORDER_WIDTH 1
/* casts are to shut gcc up */
static const GtkTargetEntry target_table[] = {
{ "text/uri-list", 0, 0 },
{ "_NETSCAPE_URL", 0, 1 }
{ (gchar*) "text/uri-list", 0, 0 },
{ (gchar*) "_NETSCAPE_URL", 0, 1 }
};
static gboolean totem_action_open_files_list (Totem *totem, GSList *list);
......@@ -535,9 +536,9 @@ totem_get_playlist_pos (Totem *totem)
* Return value: the entry title at @index, or %NULL; free with g_free()
**/
char *
totem_get_title_at_playlist_pos (Totem *totem, guint index)
totem_get_title_at_playlist_pos (Totem *totem, guint playlist_index)
{
return totem_playlist_get_title (totem->playlist, index);
return totem_playlist_get_title (totem->playlist, playlist_index);
}
/**
......@@ -1164,13 +1165,15 @@ totem_dvb_setup_result (int result, const char *device, gpointer user_data)
static gboolean
totem_action_load_media (Totem *totem, TotemDiscMediaType type, const char *device)
{
char **mrls, *msg;
char **mrls;
GError *error = NULL;
const char *link, *link_text, *secondary;
gboolean retval;
mrls = bacon_video_widget_get_mrls (totem->bvw, type, device, &error);
if (mrls == NULL) {
char *msg;
/* No errors? Weird */
if (error == NULL) {
msg = g_strdup_printf (_("Totem could not play this media (%s) although a plugin is present to handle it."), _(totem_cd_get_human_readable_name (type)));
......@@ -1178,6 +1181,7 @@ totem_action_load_media (Totem *totem, TotemDiscMediaType type, const char *devi
g_free (msg);
return FALSE;
}
/* No plugin for the media type */
if (g_error_matches (error, BVW_ERROR, BVW_ERROR_NO_PLUGIN_FOR_FILE) != FALSE) {
link = "http://www.gnome.org/projects/totem/#codecs";
......@@ -1190,8 +1194,8 @@ totem_action_load_media (Totem *totem, TotemDiscMediaType type, const char *devi
/* Device doesn't exist */
} else if (g_error_matches (error, BVW_ERROR, BVW_ERROR_INVALID_DEVICE) != FALSE) {
g_assert (type == MEDIA_TYPE_DVB);
msg = N_("Totem cannot play TV, because no TV adapters are present or they are not supported.");
totem_action_error (_(msg), _("Please insert a supported TV adapter."), totem);
totem_action_error (_