[MPlayer-cvslog] r37501 - in trunk: DOCS/xml/de/skin.xml DOCS/xml/en/skin.xml gui/ui/render.c
ib
subversion at mplayerhq.hu
Tue Sep 8 13:22:26 CEST 2015
Author: ib
Date: Tue Sep 8 13:22:26 2015
New Revision: 37501
Log:
Add new dynamic label variable $O (title name or file name).
If we have a title, show the title instead of the file name.
Additionally, update the documentation.
Modified:
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
Modified: trunk/gui/ui/render.c
==============================================================================
--- trunk/gui/ui/render.c Tue Sep 8 12:18:58 2015 (r37500)
+++ trunk/gui/ui/render.c Tue Sep 8 13:22:26 2015 (r37501)
@@ -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