]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/file_bitmap.cpp
make_URI: add scheme parameter
[vlc] / modules / gui / skins2 / src / file_bitmap.cpp
index 1724b49844ff19b00cf25b3ee242c09c8c86dd68..051de8a693dba47122afd34b72bf94f992433cda 100644 (file)
 #endif
 
 #include <vlc_common.h>
-#include "vlc_image.h"
+#include <vlc_image.h>
+#include <vlc_url.h>
 #include "file_bitmap.hpp"
 
 FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
                         string fileName, uint32_t aColor, int nbFrames,
-                        int fps ):
-    GenericBitmap( pIntf, nbFrames, fps ), m_width( 0 ), m_height( 0 ),
+                        int fps, int nbLoops ):
+    GenericBitmap( pIntf, nbFrames, fps, nbLoops ), m_width( 0 ), m_height( 0 ),
     m_pData( NULL )
 {
     video_format_t fmt_in = {0}, fmt_out = {0};
     picture_t *pPic;
 
-    fmt_out.i_chroma = VLC_FOURCC('R','G','B','A');
+    fmt_out.i_chroma = VLC_CODEC_RGBA;
 
-    pPic = image_ReadUrl( pImageHandler, fileName.c_str(), &fmt_in, &fmt_out );
-    if( !pPic ) return;
+    char* psz_uri = make_URI( fileName.c_str(), NULL );
+    pPic = image_ReadUrl( pImageHandler, psz_uri, &fmt_in, &fmt_out );
+    free( psz_uri );
+
+    if( !pPic )
+        return;
 
     m_width = fmt_out.i_width;
     m_height = fmt_out.i_height;
@@ -85,7 +90,7 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
 
 FileBitmap::~FileBitmap()
 {
-    if( m_pData ) delete[] m_pData;
+    delete[] m_pData;
 }