[MPlayer-cvslog] r37518 - in branches/1.2: . Changelog gui/dialog/fileselect.c gui/interface.c

ib subversion at mplayerhq.hu
Tue Sep 8 23:02:35 CEST 2015


Author: ib
Date: Tue Sep  8 23:02:35 2015
New Revision: 37518

Log:
Merge r37502 from trunk:

Add support for arbitrary cue sheet playlists to the GUI.

Modified:
   branches/1.2/   (props changed)
   branches/1.2/Changelog
   branches/1.2/gui/dialog/fileselect.c
   branches/1.2/gui/interface.c

Modified: branches/1.2/Changelog
==============================================================================
--- branches/1.2/Changelog	Tue Sep  8 23:02:32 2015	(r37517)
+++ branches/1.2/Changelog	Tue Sep  8 23:02:35 2015	(r37518)
@@ -58,6 +58,8 @@ MPlayer
     * Support for audio and video bin/cue image playback
     * Support for Audio CD / (Super) Video CD / DVD image and DVD copy playback
       through the respective scheme (cd://, vcd://, dvd://)
+    * Support for arbitrary non-binary data file cue sheets (i.e. cue sheets
+      describing playlists for data files containing multiple titles)
 
   1.1: "We gave up on 1.0"
 

Modified: branches/1.2/gui/dialog/fileselect.c
==============================================================================
--- branches/1.2/gui/dialog/fileselect.c	Tue Sep  8 23:02:32 2015	(r37517)
+++ branches/1.2/gui/dialog/fileselect.c	Tue Sep  8 23:02:35 2015	(r37518)
@@ -488,9 +488,7 @@ static void fs_Ok_released(GtkButton *bu
     switch (fsType) {
     case FILESELECT_VIDEO_AUDIO:
 
-        if (strcmp(fsVideoAudioFilterNames[fsLastVideoAudioFilterSelected][0], MSGTR_GUI_FilterImageCue) == 0)
-            type = STREAMTYPE_BINCUE;
-        else if (strcmp(fsVideoAudioFilterNames[fsLastVideoAudioFilterSelected][0], MSGTR_GUI_FilterFilePlaylist) == 0)
+        if (strcmp(fsVideoAudioFilterNames[fsLastVideoAudioFilterSelected][0], MSGTR_GUI_FilterFilePlaylist) == 0)
             type = STREAMTYPE_PLAYLIST;
 
         uiSetFile(fsSelectedDirectory, fsSelectedFile, type);

Modified: branches/1.2/gui/interface.c
==============================================================================
--- branches/1.2/gui/interface.c	Tue Sep  8 23:02:32 2015	(r37517)
+++ branches/1.2/gui/interface.c	Tue Sep  8 23:02:35 2015	(r37518)
@@ -32,6 +32,7 @@
 #include "ui/ui.h"
 #include "util/list.h"
 #include "util/mem.h"
+#include "util/misc.h"
 #include "util/string.h"
 #include "wm/ws.h"
 #include "wm/wsxdnd.h"
@@ -445,6 +446,9 @@ int gui(int what, void *data)
         wsMouseAutohide();
         gtkEvents();
 
+        if (guiInfo.Stop && (guiInfo.ElapsedTime >= guiInfo.Stop))
+            guiInfo.MediumChanged = GUI_MEDIUM_NEW;
+
         break;
 
     case GUI_RUN_COMMAND:
@@ -503,6 +507,9 @@ int gui(int what, void *data)
             force_fps = 0;
         }
 
+        if (gstrcmp(strrchr(guiInfo.Filename, '.'), ".cue") == 0)
+            guiInfo.StreamType = STREAMTYPE_BINCUE;
+
         switch (guiInfo.StreamType) {
         case STREAMTYPE_FILE:
         case STREAMTYPE_STREAM:
@@ -559,6 +566,30 @@ int gui(int what, void *data)
             if (strncmp(guiInfo.Filename, "cue://", 6) == 0)
                 fname += 6;
 
+            if (fname == guiInfo.Filename) {   // no scheme, so check for playlist
+                plItem **playlist = cue_playlist(guiInfo.Filename);
+
+                if (playlist) {
+                    plItem *curr = listMgr(PLAYLIST_ITEM_GET_CURR, 0);
+
+                    while (*playlist) {
+                        if (*(playlist + 1))
+                            (*playlist)->stop = (*(playlist + 1))->start;
+                        else
+                            (*playlist)->stop = 0;
+
+                        listMgr(PLAYLIST_ITEM_INSERT, *playlist);
+                        playlist++;
+                    }
+
+                    listMgr(PLAYLIST_ITEM_SET_CURR, curr);
+                    listMgr(PLAYLIST_ITEM_DEL_CURR, 0);
+
+                    guiInfo.StreamType = STREAMTYPE_FILE;
+                }
+            }
+
+            if (guiInfo.StreamType == STREAMTYPE_BINCUE) {
             colon = strrchr(fname, ':');
 
             if (colon)
@@ -566,6 +597,11 @@ int gui(int what, void *data)
 
             snprintf(tmp, sizeof(tmp), "cue://%s:%d", fname, guiInfo.Track);
             uiSetFile(NULL, tmp, SAME_STREAMTYPE);
+            } else {
+                next = listMgr(PLAYLIST_ITEM_GET_CURR, 0);
+                uiSetFileFromPlaylist(next);
+                guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
+            }
         }
         break;
         }
@@ -898,6 +934,9 @@ int gui(int what, void *data)
             }
         }
 
+        if (guiInfo.Start)
+            uiAbsSeek(guiInfo.Start);
+
         // These must be done here (in the last call from MPlayer before
         // playback starts) and not in GUI_SETUP_VIDEO_WINDOW, because...
 


More information about the MPlayer-cvslog mailing list