[vlc-devel] [PATCH] Possibility to use locale files as art pixmap

VlcVelope 1034-135 at online.de
Sun Apr 29 22:54:42 CEST 2012


This patch uses a local file called 'video.ext.vlc.png' as an art pixmap for
an input item 'video.ext' if no other art url was retrieved.
These art images could be created automatically during playback, for example.

Regards,
VlcVelope
---
 modules/gui/qt4/input_manager.cpp |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 5ee9264..dcc123a 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -661,6 +661,28 @@ const QString InputManager::decodeArtURL( input_item_t *p_item )
 
     QString path = qfu( psz_art ? psz_art : "" );
     free( psz_art );
+
+    if( path.isEmpty() )
+    {   /* If no art url was found until here */
+        char *psz_art = input_item_GetURI( p_item );
+        if( psz_art )
+        {
+            if(strncmp( psz_art, "file", 4 ) == 0 )
+            {   /* We are playing a local file, try to provide art of a thumbnail there */
+                char *psz = make_path( psz_art );
+                free( psz_art );
+                psz_art = psz;
+            }
+        }
+
+        path = qfu( psz_art ? psz_art : "" );
+        /* Append '.vlc.png' to the filename playing.
+           This way users can provide art images themselves */
+        if( !path.isEmpty() )
+            path = path + ".vlc.png";
+        free( psz_art );
+    }
+
     return path;
 }
 
-- 
1.7.5.4




More information about the vlc-devel mailing list