changeset 35348:3aba69339390

Add a file loaded by the GUI to its playlist. The GUI operates on its playlist, so the file may not be missing there. This fixes a blocking when trying to replay a file loaded by the GUI (evLoad/evLoadPlay) instead of having been given as a command line argument, as well as a segmentation fault when loading a file after a playlist has been created. Reported by Hans-Dieter Kosch, hdkosch kabelbw de.
author ib
date Thu, 22 Nov 2012 13:12:15 +0000
parents 11408d97de7a
children 60930e7347c6
files gui/ui/gtk/fileselect.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/fileselect.c	Thu Nov 22 13:10:46 2012 +0000
+++ b/gui/ui/gtk/fileselect.c	Thu Nov 22 13:12:15 2012 +0000
@@ -487,6 +487,7 @@
  GList         * item;
  int             i = 1, l;
  struct stat     fs;
+ gchar         * selected;
 
  stat( fsSelectedFile,&fs );
  if(  S_ISDIR(fs.st_mode ) )
@@ -506,6 +507,12 @@
           for (l = 0; fsVideoFilterNames[l][0]; l++)
             if (strcmp(fsVideoFilterNames[l][0], MSGTR_Filter_Playlists) == 0) break;
           uiSetFileName( fsSelectedDirectory,fsSelectedFile, fsLastVideoFilterSelected == l ? STREAMTYPE_PLAYLIST : STREAMTYPE_FILE );
+          selected = g_strconcat(fsSelectedDirectory, "/", fsSelectedFile, NULL);
+          if (selected)
+          {
+            import_file_into_gui(selected, 0);
+            g_free(selected);
+          }
           guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0;
           fs_PersistantHistory( get_current_dir_name_utf8() );      //totem, write into history
           break;