[MPlayer-cvslog] r37568 - trunk/gui/win32/widgetrender.c
ib
subversion at mplayerhq.hu
Wed Dec 23 18:23:24 CET 2015
Author: ib
Date: Wed Dec 23 18:23:23 2015
New Revision: 37568
Log:
gui/win32: Port X11 GUI changes of r37501.
Support dynamic label variable $O (title name or file name).
Patch by Alexander Strasser, eclipse7 gmx net.
Modified:
trunk/gui/win32/widgetrender.c
Modified: trunk/gui/win32/widgetrender.c
==============================================================================
--- trunk/gui/win32/widgetrender.c Mon Dec 21 23:13:27 2015 (r37567)
+++ trunk/gui/win32/widgetrender.c Wed Dec 23 18:23:23 2015 (r37568)
@@ -128,7 +128,8 @@ static void stringreplace(char *dest, co
*
* @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
*
@@ -144,7 +145,9 @@ static char *TranslateFilename (int how,
{
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, '\\');
@@ -237,6 +240,7 @@ static char *generatetextfromlabel(widge
stringreplace(text, "$D", "%3.0f", guiInfo.Balance);
stringreplace(text, "$t", "%.2i", guiInfo.Track);
stringreplace(text, "$o", "%s", acp(TranslateFilename(0, tmp, sizeof(tmp))));
+ stringreplace(text, "$O", "%s", acp(TranslateFilename(4, tmp, sizeof(tmp))));
stringreplace(text, "$x", "%i", guiInfo.VideoWidth);
stringreplace(text, "$y", "%i", guiInfo.VideoHeight);
stringreplace(text, "$C", "%s", guiInfo.sh_video ? codecname : "");
More information about the MPlayer-cvslog
mailing list