[MPlayer-cvslog] r37473 - in trunk: Changelog DOCS/xml/de/skin.xml DOCS/xml/en/skin.xml etc/mplayer.desktop gui/dialog/fileselect.c gui/interface.c gui/ui/actions.c gui/ui/render.c help/help_mp-de.h help/help_mp-en...

ib subversion at mplayerhq.hu
Fri Sep 4 10:57:34 CEST 2015


Author: ib
Date: Fri Sep  4 10:57:33 2015
New Revision: 37473

Log:
Add support for bin/cue playback to the GUI.

This utilizes the cue stream driver and thus supports both audio and
video CD images.

Don't select the (dumb) *.bin but the cue file using the file selector.
(Passing the cue:// scheme on the command line works as well.)

Allow track selection with the next/prev navigation buttons as well as
automatic next track playback just like a normal Audio CD.

For audio images temporarily utilize demuxer rawaudio.

Add the new GUI font symbol 'c'.

Additionally, update the documentation.

Modified:
   trunk/Changelog
   trunk/etc/mplayer.desktop
   trunk/gui/dialog/fileselect.c
   trunk/gui/interface.c
   trunk/gui/ui/actions.c
   trunk/gui/ui/render.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/xml/de/skin.xml
   trunk/DOCS/xml/en/skin.xml
   trunk/help/help_mp-de.h
   trunk/help/help_mp-en.h
   trunk/help/help_mp-zh_CN.h

Modified: trunk/Changelog
==============================================================================
--- trunk/Changelog	Tue Sep  1 13:24:41 2015	(r37472)
+++ trunk/Changelog	Fri Sep  4 10:57:33 2015	(r37473)
@@ -55,6 +55,7 @@ MPlayer
     * New GUI message: evSetRotation
     * GUI now officially needs GTK+ and GLib versions 2 (it hadn't compiled
       with versions 1 for quite some time)
+    * Support for audio and video bin/cue image playback
 
   1.1: "We gave up on 1.0"
 

Modified: trunk/etc/mplayer.desktop
==============================================================================
--- trunk/etc/mplayer.desktop	Tue Sep  1 13:24:41 2015	(r37472)
+++ trunk/etc/mplayer.desktop	Fri Sep  4 10:57:33 2015	(r37473)
@@ -29,4 +29,4 @@ TryExec=gmplayer
 Exec=gmplayer %F
 Terminal=false
 Categories=GTK;AudioVideo;Audio;Video;Player;TV;
-MimeType=application/mxf;application/x-netshow-channel;application/ogg;application/ram;application/vnd.adobe.flash.movie;application/vnd.rn-realmedia;application/x-shockwave-flash;application/smil;audio/aac;audio/ac3;audio/x-adpcm;audio/x-aiff;audio/AMR;audio/AMR-WB;audio/x-ape;audio/basic;audio/flac;audio/x-flac;audio/x-flac+ogg;audio/x-m4b;audio/x-matroska;audio/mp2;audio/mp4;audio/mpeg;audio/x-mpegurl;audio/x-ms-asx;audio/x-ms-wma;audio/x-musepack;audio/ogg;audio/vnd.rn-realaudio;audio/x-scpls;audio/x-voc;audio/x-vorbis+ogg;audio/x-wav;audio/x-wavpack;video/3gpp;video/3gpp2;video/dv;video/x-flic;video/x-flv;video/x-matroska;video/mp2t;video/mp4;video/mpeg;video/vnd.mpegurl;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/ogg;video/x-ogm+ogg;video/quicktime;video/vnd.rn-realvideo;video/x-theora+ogg;video/webm;x-content/audio-cdda;x-content/audio-dvd;x-content/video-dvd;x-content/video-svcd;x-content/video-vcd;
+MimeType=application/x-cue;application/mxf;application/x-netshow-channel;application/ogg;application/ram;application/vnd.adobe.flash.movie;application/vnd.rn-realmedia;application/x-shockwave-flash;application/smil;audio/aac;audio/ac3;audio/x-adpcm;audio/x-aiff;audio/AMR;audio/AMR-WB;audio/x-ape;audio/basic;audio/flac;audio/x-flac;audio/x-flac+ogg;audio/x-m4b;audio/x-matroska;audio/mp2;audio/mp4;audio/mpeg;audio/x-mpegurl;audio/x-ms-asx;audio/x-ms-wma;audio/x-musepack;audio/ogg;audio/vnd.rn-realaudio;audio/x-scpls;audio/x-voc;audio/x-vorbis+ogg;audio/x-wav;audio/x-wavpack;video/3gpp;video/3gpp2;video/dv;video/x-flic;video/x-flv;video/x-matroska;video/mp2t;video/mp4;video/mpeg;video/vnd.mpegurl;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/ogg;video/x-ogm+ogg;video/quicktime;video/vnd.rn-realvideo;video/x-theora+ogg;video/webm;x-content/audio-cdda;x-content/audio-dvd;x-content/video-dvd;x-content/video-svcd;x-content/video-vcd;

Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c	Tue Sep  1 13:24:41 2015	(r37472)
+++ trunk/gui/dialog/fileselect.c	Fri Sep  4 10:57:33 2015	(r37473)
@@ -75,12 +75,12 @@ char *fsVideoAudioFilterNames[][2] = {
     { MSGTR_GUI_FilterMediumOgg,          "*.oga,*.ogg,*.ogm,*.ogv,*.ogx,*.spx"                                                                                                                                                                                                                                                                                                                                                                                   },
     { MSGTR_GUI_FilterMediumQuickTime,    "*.moov,*.mov,*.qt,*.qtvr"                                                                                                                                                                                                                                                                                                                                                                                              },
     { MSGTR_GUI_FilterMediumRealNetworks, "*.ra,*.rm,*.rmvb,*.rv"                                                                                                                                                                                                                                                                                                                                                                                                 },
-    { MSGTR_GUI_FilterImageVCD,           "*.bin"                                                                                                                                                                                                                                                                                                                                                                                                                 },
+    { MSGTR_GUI_FilterImageCue,           "*.cue"                                                                                                                                                                                                                                                                                                                                                                                                                 },
     { MSGTR_GUI_FilterFileWav,            "*.wav"                                                                                                                                                                                                                                                                                                                                                                                                                 },
     { MSGTR_GUI_FilterMediumWindows,      "*.asf,*.wma,*.wmv"                                                                                                                                                                                                                                                                                                                                                                                                     },
     { MSGTR_GUI_FilterFilePlaylist,       "*.asx,*.m3u,*.m3u8,*.m4u,*.mxu,*.nsc,*.pls,*.ram,*.smi,*.smil,*.sml,*.vlc,*.wax,*.wmx,*.wvx"                                                                                                                                                                                                                                                                                                                           },
     { MSGTR_GUI_FilterAudioAll,           "*.aac,*.ac3,*.aif,*.aifc,*.aiff,*.amr,*.ape,*.au,*.awb,*.cdg,*.f4a,*.f4b,*.flac,*.m4a,*.m4b,*.mka,*.mp+,*.mp2,*.mp3,*.mpc,*.mpga,*.mpp,*.nsa,*.oga,*.ogg,*.pcm,*.qcp,*.ra,*.snd,*.spx,*.tak,*.voc,*.vqf,*.w64,*.wav,*.wma,*.wv,*.wvp"                                                                                                                                                                                  },
-    { MSGTR_GUI_FilterVideoAll,           "*.264,*.3g2,*.3ga,*.3gp,*.3gp2,*.3gpp,*.3gpp2,*.asf,*.avi,*.bdm,*.bdmv,*.bin,*.clpi,*.cpi,*.cpk,*.divx,*.dv,*.f4v,*.flc,*.fli,*.flv,*.m1v,*.m2t,*.m2ts,*.m2v,*.m4v,*.mjpg,*.mkv,*.moov,*.mov,*.mp2,*.mp4,*.mpe,*.mpeg,*.mpg,*.mpl,*.mpls,*.mts,*.mxf,*.nsv,*.nuv,*.ogg,*.ogm,*.ogv,*.ogx,*.pva,*.qt,*.qtvr,*.rec,*.rm,*.rmvb,*.roq,*.rv,*.spl,*.str,*.swf,*.trp,*.ts,*.ty,*.vdr,*.viv,*.vivo,*.vob,*.webm,*.wmv,*.y4m" },
+    { MSGTR_GUI_FilterVideoAll,           "*.264,*.3g2,*.3ga,*.3gp,*.3gp2,*.3gpp,*.3gpp2,*.asf,*.avi,*.bdm,*.bdmv,*.clpi,*.cpi,*.cpk,*.divx,*.dv,*.f4v,*.flc,*.fli,*.flv,*.m1v,*.m2t,*.m2ts,*.m2v,*.m4v,*.mjpg,*.mkv,*.moov,*.mov,*.mp2,*.mp4,*.mpe,*.mpeg,*.mpg,*.mpl,*.mpls,*.mts,*.mxf,*.nsv,*.nuv,*.ogg,*.ogm,*.ogv,*.ogx,*.pva,*.qt,*.qtvr,*.rec,*.rm,*.rmvb,*.roq,*.rv,*.spl,*.str,*.swf,*.trp,*.ts,*.ty,*.vdr,*.viv,*.vivo,*.vob,*.webm,*.wmv,*.y4m"       },
     { MSGTR_GUI_FilterFileAll,            "*"                                                                                                                                                                                                                                                                                                                                                                                                                     },
     { NULL,                               NULL                                                                                                                                                                                                                                                                                                                                                                                                                    }
 };
@@ -437,7 +437,7 @@ static void fs_Cancel_released(GtkButton
 static void fs_Ok_released(GtkButton *button, gpointer user_data)
 {
     char *fsSelectedDirectory;
-    int l;
+    int type = STREAMTYPE_FILE;
     struct stat fs;
     gchar *selected;
 
@@ -465,11 +465,12 @@ static void fs_Ok_released(GtkButton *bu
     switch (fsType) {
     case FILESELECT_VIDEO_AUDIO:
 
-        for (l = 0; fsVideoAudioFilterNames[l][0]; l++)
-            if (strcmp(fsVideoAudioFilterNames[l][0], MSGTR_GUI_FilterFilePlaylist) == 0)
-                break;
+        if (strcmp(fsVideoAudioFilterNames[fsLastVideoAudioFilterSelected][0], MSGTR_GUI_FilterImageCue) == 0)
+            type = STREAMTYPE_BINCUE;
+        else if (strcmp(fsVideoAudioFilterNames[fsLastVideoAudioFilterSelected][0], MSGTR_GUI_FilterFilePlaylist) == 0)
+            type = STREAMTYPE_PLAYLIST;
 
-        uiSetFile(fsSelectedDirectory, fsSelectedFile, fsLastVideoAudioFilterSelected == l ? STREAMTYPE_PLAYLIST : STREAMTYPE_FILE);
+        uiSetFile(fsSelectedDirectory, fsSelectedFile, type);
         selected = g_strconcat(fsSelectedDirectory, "/", fsSelectedFile, NULL);
 
         if (selected) {

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue Sep  1 13:24:41 2015	(r37472)
+++ trunk/gui/interface.c	Fri Sep  4 10:57:33 2015	(r37473)
@@ -53,6 +53,7 @@
 #include "libmpcodecs/dec_video.h"
 #include "libmpcodecs/vd.h"
 #include "libmpcodecs/vf.h"
+#include "libmpdemux/demuxer.h"
 #include "libvo/video_out.h"
 #include "libvo/x11_common.h"
 #include "osdep/timer.h"
@@ -76,6 +77,10 @@ guiInterface_t guiInfo = {
 
 static int guiInitialized;
 static int orig_fontconfig;
+static struct {
+    int changed;
+    char *name;
+} orig_demuxer;
 
 /**
  * @brief Set option 'fontconfig' depending on #font_name.
@@ -544,6 +549,25 @@ int gui(int what, void *data)
             uiSetFile(NULL, tmp, SAME_STREAMTYPE);
         }
         break;
+
+        case STREAMTYPE_BINCUE:
+        {
+            char tmp[512], *fname, *colon;
+
+            fname = guiInfo.Filename;
+
+            if (strncmp(guiInfo.Filename, "cue://", 6) == 0)
+                fname += 6;
+
+            colon = strrchr(fname, ':');
+
+            if (colon)
+                *colon = 0;
+
+            snprintf(tmp, sizeof(tmp), "cue://%s:%d", fname, guiInfo.Track);
+            uiSetFile(NULL, tmp, SAME_STREAMTYPE);
+        }
+        break;
         }
 
         /* video opts */
@@ -730,6 +754,12 @@ int gui(int what, void *data)
             guiInfo.StreamType = stream->type;
         }
 
+        if (orig_demuxer.changed) {
+            free(demuxer_name);
+            demuxer_name = orig_demuxer.name;
+            orig_demuxer.changed = False;
+        }
+
         switch (guiInfo.StreamType) {
         case STREAMTYPE_FILE:
         case STREAMTYPE_STREAM:
@@ -775,6 +805,22 @@ int gui(int what, void *data)
         case STREAMTYPE_DVB:
             guiInfo.Tracks = guiInfo.Track = 1;
             break;
+
+        case STREAMTYPE_BINCUE:
+
+            guiInfo.Tracks = 0;
+            stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
+            if (stream_control(stream, STREAM_CTRL_GET_CURRENT_TITLE, &guiInfo.Track) == STREAM_OK)
+                guiInfo.Track++;
+            stream_control(stream, STREAM_CTRL_GET_NUM_ANGLES, &guiInfo.Angles);
+
+            if (guiInfo.Angles == 0) {
+                orig_demuxer.name    = demuxer_name;
+                demuxer_name         = strdup("rawaudio");
+                orig_demuxer.changed = True;
+            }
+
+            break;
         }
 
         break;
@@ -927,7 +973,7 @@ int gui(int what, void *data)
                 break;
             }
 
-            if (guiInfo.StreamType == STREAMTYPE_CDDA && guiInfo.Track < guiInfo.Tracks) {
+            if ((guiInfo.StreamType == STREAMTYPE_CDDA || guiInfo.StreamType == STREAMTYPE_BINCUE) && guiInfo.Track < guiInfo.Tracks) {
                 uiNext();
                 break;
             }
@@ -956,7 +1002,21 @@ int gui(int what, void *data)
                     guiInfo.Track = 1;
                 }
             } else if (guiInfo.Playing) {
-                int first = (guiInfo.StreamType == STREAMTYPE_VCD ? 2 : 1);
+                int first;
+
+                switch (guiInfo.StreamType) {
+                case STREAMTYPE_VCD:
+                    first = 2;
+                    break;
+
+                case STREAMTYPE_BINCUE:
+                    first = 1 + guiInfo.Angles;
+                    break;
+
+                default:
+                    first = 1;
+                    break;
+                }
 
                 if (guiInfo.Track != first) {
                     uiUnsetMedia(True);

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Tue Sep  1 13:24:41 2015	(r37472)
+++ trunk/gui/ui/actions.c	Fri Sep  4 10:57:33 2015	(r37473)
@@ -84,10 +84,11 @@ static void MediumPrepare(int type)
     case STREAMTYPE_FILE:
     case STREAMTYPE_STREAM:
     case STREAMTYPE_PLAYLIST:
+        guiInfo.Angles = 0;
+    case STREAMTYPE_BINCUE:
         guiInfo.AudioStreams = 0;
         guiInfo.Subtitles    = 0;
         guiInfo.Chapters     = 0;
-        guiInfo.Angles       = 0;
         break;
     }
 }
@@ -210,6 +211,7 @@ play:
                 if (!guiInfo.Track)
                     guiInfo.Track = (guiInfo.StreamType == STREAMTYPE_VCD ? 2 : 1);
 
+            case STREAMTYPE_BINCUE:   // track 0 is OK and will auto-select first media data track
                 guiInfo.MediumChanged = GUI_MEDIUM_SAME;
 
                 break;
@@ -740,7 +742,9 @@ void uiUnsetMedia(int totals)
 
     if (totals) {
         guiInfo.Chapters = 0;
-        guiInfo.Angles   = 0;
+
+        if (guiInfo.StreamType != STREAMTYPE_BINCUE)
+            guiInfo.Angles = 0;
     } else {
         guiInfo.Track   = 0;
         guiInfo.Chapter = 0;
@@ -841,6 +845,15 @@ void uiPrev(void)
 
         return;
 
+    case STREAMTYPE_BINCUE:
+
+        if (--guiInfo.Track == 0) {
+            guiInfo.Track = 1 + guiInfo.Angles;
+            stop = True;
+        }
+
+        break;
+
     default:
 
         prev = listMgr(PLAYLIST_ITEM_GET_PREV, 0);
@@ -878,6 +891,7 @@ void uiNext(void)
     switch (guiInfo.StreamType) {
     case STREAMTYPE_CDDA:
     case STREAMTYPE_VCD:
+    case STREAMTYPE_BINCUE:
 
         if (++guiInfo.Track > guiInfo.Tracks) {
             guiInfo.Track = guiInfo.Tracks;

Modified: trunk/gui/ui/render.c
==============================================================================
--- trunk/gui/ui/render.c	Tue Sep  1 13:24:41 2015	(r37472)
+++ trunk/gui/ui/render.c	Fri Sep  4 10:57:33 2015	(r37473)
@@ -123,6 +123,15 @@ static char *TranslateFilename(int how,
         av_strlcpy(fname, p, maxlen);
         break;
 
+    case STREAMTYPE_BINCUE:
+
+        if (guiInfo.Track)
+            snprintf(fname, maxlen, MSGTR_GUI_TitleN, guiInfo.Track - guiInfo.Angles);
+        else
+            *fname = 0;
+
+        break;
+
     default:
 
         av_strlcpy(fname, MSGTR_GUI_MSG_NoMediaOpened, maxlen);
@@ -320,6 +329,10 @@ MMMM_SS:        snprintf(trans, sizeof(t
                     av_strlcat(translation, "b", sizeof(translation));
                     break;
 
+                case STREAMTYPE_BINCUE:
+                    av_strlcat(translation, "c", sizeof(translation));
+                    break;
+
                 default:
                     av_strlcat(translation, " ", sizeof(translation));
                     break;


More information about the MPlayer-cvslog mailing list