"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/xitk/main.c" between
xine-ui-0.99.13.tar.bz2 and xine-ui-0.99.14.tar.bz2

About: xine is a free video player which plays mpeg-2 and mpeg-1 video, DVDs (unlocked/unencrypted only), video CDs, SVCDs, and AVI files (using Win32 codecs) with synchronized audio and video, and optionally fullscreen using the Xv extensions in Xfree86 4.x (user interface).

main.c  (xine-ui-0.99.13.tar.bz2):main.c  (xine-ui-0.99.14.tar.bz2)
/** Copyright (C) 2000-2021 the xine project /** Copyright (C) 2000-2022 the xine project
* *
* This file is part of xine, a unix video player. * This file is part of xine, a unix video player.
* *
* xine is free software; you can redistribute it and/or modify * xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* xine is distributed in the hope that it will be useful, * xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 891 skipping to change at line 891
break; break;
/* inform ui that new channel info is available */ /* inform ui that new channel info is available */
case XINE_EVENT_UI_CHANNELS_CHANGED: case XINE_EVENT_UI_CHANNELS_CHANGED:
if(event->stream == gui->stream) if(event->stream == gui->stream)
panel_update_channel_display (gui->panel); panel_update_channel_display (gui->panel);
break; break;
/* request title display change in ui */ /* request title display change in ui */
case XINE_EVENT_UI_SET_TITLE: case XINE_EVENT_UI_SET_TITLE:
if(event->stream == gui->stream) { if (event->stream == gui->stream) {
xine_ui_data_t *uevent = (xine_ui_data_t *) event->data; xine_ui_data_t *uevent = (xine_ui_data_t *) event->data;
mediamark_t *m = &gui->mmk;
int changed;
pthread_mutex_lock (&gui->mmk_mutex); gui_playlist_set_str_val (gui, uevent->str, MMK_VAL_IDENT, GUI_MMK_CURRENT
if(strcmp(gui->mmk.ident, uevent->str)) { );
gui_playlist_lock (gui);
free(gui->mmk.ident); changed = mediamark_set_str_val (&m, uevent->str, MMK_VAL_IDENT);
if(gui->playlist.num && gui->playlist.cur >= 0 && gui->playlist.mmk && gui_playlist_unlock (gui);
gui->playlist.mmk[gui->playlist.cur]) {
free(gui->playlist.mmk[gui->playlist.cur]->ident);
gui->playlist.mmk[gui->playlist.cur]->ident = strdup(uevent->str);
}
gui->mmk.ident = strdup(uevent->str);
pthread_mutex_unlock (&gui->mmk_mutex);
if (changed) {
video_window_set_mrl (gui->vwin, uevent->str); video_window_set_mrl (gui->vwin, uevent->str);
playlist_mrlident_toggle (gui); playlist_mrlident_toggle (gui);
panel_update_mrl_display (gui->panel); panel_update_mrl_display (gui->panel);
} else {
pthread_mutex_unlock (&gui->mmk_mutex);
} }
} }
break; break;
/* message (dialog) for the ui to display */ /* message (dialog) for the ui to display */
case XINE_EVENT_UI_MESSAGE: case XINE_EVENT_UI_MESSAGE:
if(event->stream == gui->stream) { if(event->stream == gui->stream) {
xine_ui_message_data_t *data = (xine_ui_message_data_t *) event->data; xine_ui_message_data_t *data = (xine_ui_message_data_t *) event->data;
char buffer[8192], *q = buffer, *e = buffer + sizeof (b uffer) - 16; char buffer[8192], *q = buffer, *e = buffer + sizeof (b uffer) - 16;
const char *s1, *s2 = NULL; const char *s1, *s2 = NULL;
skipping to change at line 988 skipping to change at line 980
break; break;
case XINE_MSG_LIBRARY_LOAD_ERROR: /* (library/decoder) */ case XINE_MSG_LIBRARY_LOAD_ERROR: /* (library/decoder) */
s1 = _("A problem occurred while loading a library or a decoder"); s1 = _("A problem occurred while loading a library or a decoder");
flags = _MSG_WITH_ARGS; flags = _MSG_WITH_ARGS;
break; break;
case XINE_MSG_ENCRYPTED_SOURCE: /* none */ case XINE_MSG_ENCRYPTED_SOURCE: /* none */
s1 = _("The source seems encrypted, and can't be read."); s1 = _("The source seems encrypted, and can't be read.");
flags = _MSG_WITH_ARGS; flags = _MSG_WITH_ARGS;
{ {
int i; int i;
pthread_mutex_lock (&gui->mmk_mutex); gui_playlist_lock (gui);
i = strncasecmp (gui->mmk.mrl, "dvd:/", 5); i = strncasecmp (gui->mmk.mrl, "dvd:/", 5);
pthread_mutex_unlock (&gui->mmk_mutex); gui_playlist_unlock (gui);
if (!i) if (!i)
s2 = _("\nYour DVD is probably crypted. According to your country laws, you can or can't " s2 = _("\nYour DVD is probably crypted. According to your country laws, you can or can't "
"install/use libdvdcss to be able to read this disc, which you bought."); "install/use libdvdcss to be able to read this disc, which you bought.");
} }
break; break;
case XINE_MSG_SECURITY: /* (warning message) */ case XINE_MSG_SECURITY: /* (warning message) */
s1 = ""; s1 = "";
flags = _MSG_WITH_EXPL | _MSG_WITH_ARGS; flags = _MSG_WITH_EXPL | _MSG_WITH_ARGS;
break; break;
case XINE_MSG_AUDIO_OUT_UNAVAILABLE: case XINE_MSG_AUDIO_OUT_UNAVAILABLE:
skipping to change at line 1130 skipping to change at line 1122
#if XINE_VERSION_CODE < 10200 #if XINE_VERSION_CODE < 10200
case XINE_EVENT_MRL_REFERENCE: case XINE_EVENT_MRL_REFERENCE:
if(!mrl_ext && (event->stream == gui->stream) && gui->playlist.num) { if(!mrl_ext && (event->stream == gui->stream) && gui->playlist.num) {
xine_mrl_reference_data_t *ref = (xine_mrl_reference_data_t *) event->data ; xine_mrl_reference_data_t *ref = (xine_mrl_reference_data_t *) event->data ;
if (gui->verbosity) if (gui->verbosity)
printf("XINE_EVENT_MRL_REFERENCE got mrl [%s] (alternative=%d)\n", printf("XINE_EVENT_MRL_REFERENCE got mrl [%s] (alternative=%d)\n",
ref->mrl, ref->alternative); ref->mrl, ref->alternative);
gui_playlist_lock (gui);
if(ref->alternative == 0) { if(ref->alternative == 0) {
gui->playlist.ref_append++; gui->playlist.ref_append++;
mediamark_insert_entry(gui->playlist.ref_append, ref->mrl, ref->mrl, NUL L, 0, -1, 0, 0); gui_playlist_insert(gui->playlist.ref_append, ref->mrl, ref->mrl, NULL, 0, -1, 0, 0);
} else { } else {
pthread_mutex_lock (&gui->mmk_mutex); gui_playlist_set_str_val (gui, ref->mrl, MMK_VAL_ADD_ALTER, gui->playlis
mediamark_t *mmk = mediamark_get_mmk_by_index(gui->playlist.ref_append); t.ref_append);
if(mmk) {
mediamark_append_alternate_mrl(mmk, ref->mrl);
mediamark_set_got_alternate(mmk);
}
pthread_mutex_unlock (&gui->mmk_mutex);
} }
gui_playlist_unlock (gui);
} }
break; break;
#endif #endif
#ifndef XINE_EVENT_MRL_REFERENCE_EXT #ifndef XINE_EVENT_MRL_REFERENCE_EXT
/* present in 1.1.0 but not 1.0.2 */ /* present in 1.1.0 but not 1.0.2 */
#define XINE_EVENT_MRL_REFERENCE_EXT 13 #define XINE_EVENT_MRL_REFERENCE_EXT 13
typedef struct { typedef struct {
int alternative, start_time, duration; int alternative, start_time, duration;
skipping to change at line 1168 skipping to change at line 1154
if((event->stream == gui->stream) && gui->playlist.num) { if((event->stream == gui->stream) && gui->playlist.num) {
xine_mrl_reference_data_ext_t *ref = (xine_mrl_reference_data_ext_t *) eve nt->data; xine_mrl_reference_data_ext_t *ref = (xine_mrl_reference_data_ext_t *) eve nt->data;
const char *title = ref->mrl + strlen (ref->mrl) + 1; const char *title = ref->mrl + strlen (ref->mrl) + 1;
#if XINE_VERSION_CODE < 10200 #if XINE_VERSION_CODE < 10200
mrl_ext = 1; /* use this to ignore MRL_REFERENCE events */ mrl_ext = 1; /* use this to ignore MRL_REFERENCE events */
#endif #endif
if (gui->verbosity) if (gui->verbosity)
printf("XINE_EVENT_MRL_REFERENCE_EXT got mrl [%s] (alternative=%d)\n", printf("XINE_EVENT_MRL_REFERENCE_EXT got mrl [%s] (alternative=%d)\n",
ref->mrl, ref->alternative); ref->mrl, ref->alternative);
gui_playlist_lock (gui);
if(ref->alternative == 0) { if(ref->alternative == 0) {
gui->playlist.ref_append++; gui->playlist.ref_append++;
/* FIXME: duration handled correctly? */ /* FIXME: duration handled correctly? */
mediamark_insert_entry (gui, gui->playlist.ref_append, ref->mrl, *title ? title : ref->mrl, NULL, gui_playlist_insert (gui, gui->playlist.ref_append, ref->mrl, *title ? t itle : ref->mrl, NULL,
ref->start_time, ref->start_time,
ref->duration ? (int)(ref->start_time + ref->dura tion) : -1, ref->duration ? (int)(ref->start_time + ref->dura tion) : -1,
0, 0); 0, 0);
} else { } else {
/* FIXME: title? start? duration? */ /* FIXME: title? start? duration? */
pthread_mutex_lock (&gui->mmk_mutex); gui_playlist_set_str_val (gui, ref->mrl, MMK_VAL_ADD_ALTER, gui->playlis
mediamark_t *mmk = mediamark_get_mmk_by_index (gui, gui->playlist.ref_ap t.ref_append);
pend);
if(mmk) {
mediamark_append_alternate_mrl(mmk, ref->mrl);
mediamark_set_got_alternate(mmk);
}
pthread_mutex_unlock (&gui->mmk_mutex);
} }
gui_playlist_unlock (gui);
} }
break; break;
case XINE_EVENT_UI_NUM_BUTTONS: case XINE_EVENT_UI_NUM_BUTTONS:
break; break;
case XINE_EVENT_SPU_BUTTON: case XINE_EVENT_SPU_BUTTON:
{ {
xine_spu_button_t *spubtn = (xine_spu_button_t *) event->data; xine_spu_button_t *spubtn = (xine_spu_button_t *) event->data;
skipping to change at line 1290 skipping to change at line 1271
gui->stream = NULL; gui->stream = NULL;
gui->debug_level = 0; gui->debug_level = 0;
gui->autoscan_plugin = NULL; gui->autoscan_plugin = NULL;
gui->cursor_grabbed = 0; gui->cursor_grabbed = 0;
gui->network = 0; gui->network = 0;
gui->network_port = 0; gui->network_port = 0;
gui->use_root_window = 0; gui->use_root_window = 0;
gui->actions_on_start[aos] = ACTID_NOKEY; gui->actions_on_start[aos] = ACTID_NOKEY;
gui->playlist.mmk = NULL;
gui->playlist.loop = PLAYLIST_LOOP_NO_LOOP;
gui->playlist.control = 0;
gui->skin_server_url = NULL; gui->skin_server_url = NULL;
gui->verbosity = 0; gui->verbosity = 0;
gui->broadcast_port = 0; gui->broadcast_port = 0;
gui->display_logo = 1; gui->display_logo = 1;
gui->post_video_enable = 1; gui->post_video_enable = 1;
gui->post_audio_enable = 1; gui->post_audio_enable = 1;
gui->splash = 1; gui->splash = 1;
gui->lirc_enable = 1; gui->lirc_enable = 1;
gui->deinterlace_enable = 0; gui->deinterlace_enable = 0;
gui->report = stdout; gui->report = stdout;
skipping to change at line 1352 skipping to change at line 1330
{ {
pthread_mutexattr_t attr; pthread_mutexattr_t attr;
pthread_mutexattr_init (&attr); pthread_mutexattr_init (&attr);
pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init (&gui->mmk_mutex, &attr); pthread_mutex_init (&gui->mmk_mutex, &attr);
pthread_mutexattr_destroy (&attr); pthread_mutexattr_destroy (&attr);
} }
visual_anim_init (gui); visual_anim_init (gui);
gui_playlist_init (gui);
/* /*
* parse command line * parse command line
*/ */
opterr = 0; opterr = 0;
while((c = getopt_long(_argc, _argv, short_options, while((c = getopt_long(_argc, _argv, short_options,
long_options, &option_index)) != EOF) { long_options, &option_index)) != EOF) {
switch(c) { switch(c) {
case 'L': /* Disable LIRC support */ case 'L': /* Disable LIRC support */
gui->lirc_enable = 0; gui->lirc_enable = 0;
skipping to change at line 1566 skipping to change at line 1546
if (optarg) { if (optarg) {
visual_anim_add_animation (gui, optarg); visual_anim_add_animation (gui, optarg);
} }
break; break;
case 'P': case 'P':
if (optarg) { if (optarg) {
if((!actions_on_start(gui->actions_on_start, ACTID_PLAYLIST) && (aos < MAX _ACTIONS_ON_START))) if((!actions_on_start(gui->actions_on_start, ACTID_PLAYLIST) && (aos < MAX _ACTIONS_ON_START)))
gui->actions_on_start[aos++] = ACTID_PLAYLIST; gui->actions_on_start[aos++] = ACTID_PLAYLIST;
pthread_mutex_lock (&gui->mmk_mutex); gui_playlist_add_item (gui, optarg, 1, GUI_ITEM_TYPE_PLAYLIST, 0);
if(!gui->playlist.mmk)
mediamark_load_mediamarks (gui, optarg);
else
mediamark_concat_mediamarks (gui, optarg);
pthread_mutex_unlock (&gui->mmk_mutex);
/* don't load original playlist when loading this one */ /* don't load original playlist when loading this one */
no_old_playlist = 1; no_old_playlist = 1;
} }
break; break;
case 'l': case 'l':
if(optarg != NULL) { if(optarg != NULL) {
char *p = xine_chomp(optarg); char *p = xine_chomp(optarg);
skipping to change at line 1883 skipping to change at line 1858
_("If it's enabled and if you don't specify any MRL in command " _("If it's enabled and if you don't specify any MRL in command "
"line, xine will automatically load previous play list."), "line, xine will automatically load previous play list."),
CONFIG_LEVEL_BEG, CONFIG_LEVEL_BEG,
dummy_config_cb, dummy_config_cb,
gui); gui);
if(old_playlist_cfg && (!(_argc - optind)) && (!no_old_playlist)) { if(old_playlist_cfg && (!(_argc - optind)) && (!no_old_playlist)) {
char buffer[XITK_PATH_MAX + XITK_NAME_MAX + 2]; char buffer[XITK_PATH_MAX + XITK_NAME_MAX + 2];
snprintf(buffer, sizeof(buffer), "%s/.xine/xine-ui_old_playlist.tox", xine_g et_homedir()); snprintf(buffer, sizeof(buffer), "%s/.xine/xine-ui_old_playlist.tox", xine_g et_homedir());
mediamark_load_mediamarks (gui, buffer); gui_playlist_add_item (gui, buffer, 1, GUI_ITEM_TYPE_PLAYLIST, 0);
} }
gui->subtitle_autoload = gui->subtitle_autoload =
xine_config_register_bool (gui->xine, "gui.subtitle_autoload", 1, xine_config_register_bool (gui->xine, "gui.subtitle_autoload", 1,
_("Subtitle autoloading"), _("Subtitle autoloading"),
_("Automatically load subtitles if they exist."), _("Automatically load subtitles if they exist."),
CONFIG_LEVEL_BEG, CONFIG_LEVEL_BEG,
sub_autoload_cb, sub_autoload_cb,
gui); gui);
skipping to change at line 2162 skipping to change at line 2137
fclose(gui->report); fclose(gui->report);
if(gui->orig_stdout != stdout) if(gui->orig_stdout != stdout)
fclose(gui->orig_stdout); fclose(gui->orig_stdout);
free_command_line_args(&_argv, _argc); free_command_line_args(&_argv, _argc);
free (gui->cfg_file); free (gui->cfg_file);
free(gui->keymap_file); free(gui->keymap_file);
gui_playlist_deinit (gui);
free (gui); free (gui);
return retval; return retval;
} }
void gui_load_window_pos (gGui_t *gui, const char *name, int *x, int *y) { void gui_load_window_pos (gGui_t *gui, const char *name, int *x, int *y) {
char buf[80], *e; char buf[80], *e;
memcpy (buf, "gui.", 4); memcpy (buf, "gui.", 4);
for (e = buf + 4; *name; name++) for (e = buf + 4; *name; name++)
*e++ = *name; *e++ = *name;
 End of changes. 21 change blocks. 
49 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)