[MPlayer-cvslog] r37517 - in branches/1.2: . DOCS/xml/de/skin.xml DOCS/xml/en/skin.xml gui/ui/render.c

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


Author: ib
Date: Tue Sep  8 23:02:32 2015
New Revision: 37517

Log:
Merge r37501 from trunk:

Add new dynamic label variable $O (title name or file name).

Modified:
   branches/1.2/   (props changed)
   branches/1.2/DOCS/xml/de/skin.xml
   branches/1.2/DOCS/xml/en/skin.xml
   branches/1.2/gui/ui/render.c

Modified: branches/1.2/DOCS/xml/de/skin.xml
==============================================================================
--- branches/1.2/DOCS/xml/de/skin.xml	Tue Sep  8 23:02:29 2015	(r37516)
+++ branches/1.2/DOCS/xml/de/skin.xml	Tue Sep  8 23:02:32 2015	(r37517)
@@ -736,6 +736,13 @@ end
                     <entry>Dateiname</entry>
                   </row>
                   <row>
+                    <entry>$O</entry>
+                    <entry>
+                      Dateiname (falls kein Titelname verf├╝gbar), ansonsten
+                      der Titel
+                    </entry>
+                  </row>
+                  <row>
                     <entry>$f</entry>
                     <entry>Dateiname in Kleinbuchstaben</entry>
                   </row>

Modified: branches/1.2/DOCS/xml/en/skin.xml
==============================================================================
--- branches/1.2/DOCS/xml/en/skin.xml	Tue Sep  8 23:02:29 2015	(r37516)
+++ branches/1.2/DOCS/xml/en/skin.xml	Tue Sep  8 23:02:32 2015	(r37517)
@@ -606,6 +606,10 @@ blocks.
     <entry>filename</entry>
   </row>
   <row>
+    <entry>$O</entry>
+    <entry>filename (if no title name available) otherwise title</entry>
+  </row>
+  <row>
     <entry>$f</entry>
     <entry>filename in lower case</entry>
   </row>

Modified: branches/1.2/gui/ui/render.c
==============================================================================
--- branches/1.2/gui/ui/render.c	Tue Sep  8 23:02:29 2015	(r37516)
+++ branches/1.2/gui/ui/render.c	Tue Sep  8 23:02:32 2015	(r37517)
@@ -51,7 +51,8 @@
  *
  * @param how 0 (cut file path and extension),
  *            1 (additionally, convert lower case) or
- *            2 (additionally, convert upper case)
+ *            2 (additionally, convert upper case) or
+ *            4 (unaltered title if available, otherwise like 0)
  * @param fname memory location of a buffer to receive the converted Filename
  * @param maxlen size of the @a fname buffer
  *
@@ -66,7 +67,9 @@ static char *TranslateFilename(int how,
     switch (guiInfo.StreamType) {
     case STREAMTYPE_FILE:
 
-        if (guiInfo.Filename && *guiInfo.Filename) {
+        if ((how == 4) && guiInfo.Title)
+            av_strlcpy(fname, guiInfo.Title, maxlen);
+        else if (guiInfo.Filename && *guiInfo.Filename) {
             p = strrchr(guiInfo.Filename, '/');
 
             if (p)
@@ -270,6 +273,11 @@ MMMM_SS:        snprintf(trans, sizeof(t
                 av_strlcat(translation, trans, sizeof(translation));
                 break;
 
+            case 'O':
+                TranslateFilename(4, trans, sizeof(trans));
+                av_strlcat(translation, trans, sizeof(translation));
+                break;
+
             case 'l': // legacy
             case 'p':
                 if (guiInfo.Playing == GUI_PLAY)


More information about the MPlayer-cvslog mailing list