Modify meta writer callback to take an input_item_t as argument, so a file non playing can be written
/* divers */
typedef struct vlc_meta_t vlc_meta_t;
/* divers */
typedef struct vlc_meta_t vlc_meta_t;
-typedef struct meta_export_t meta_export_t;
/* Stats */
typedef struct counter_t counter_t;
/* Stats */
typedef struct counter_t counter_t;
-struct meta_export_t
-{
- input_item_t *p_item;
- const char *psz_file;
-};
-
#define VLC_META_ENGINE_TITLE 0x00000001
#define VLC_META_ENGINE_ARTIST 0x00000004
#define VLC_META_ENGINE_GENRE 0x00000008
#define VLC_META_ENGINE_TITLE 0x00000001
#define VLC_META_ENGINE_ARTIST 0x00000004
#define VLC_META_ENGINE_GENRE 0x00000008
static int WriteMeta( vlc_object_t *p_this )
{
static int WriteMeta( vlc_object_t *p_this )
{
- playlist_t *p_playlist = (playlist_t *)p_this;
- meta_export_t *p_export = (meta_export_t *)p_playlist->p_private;
- input_item_t *p_item = p_export->p_item;
+ input_item_t *p_item = (input_item_t *)p_this;
- TagLib::FileRef f( p_export->psz_file );
+ char *psz_uri = p_item->psz_uri;
+ /* we can write meta data only in a file */
+ if( !strncmp( psz_uri, "file://", 7 ) )
+ psz_uri += 7;
+ /* if the file is specified with its path, not prefixed with file:// */
+ else if( strncmp( psz_uri, "/", 1 ) )
+ return VLC_EGENERIC;
+
+ TagLib::FileRef f( psz_uri );
if( !f.isNull() && f.tag() )
{
TagLib::Tag *tag = f.tag();
if( !f.isNull() && f.tag() )
{
TagLib::Tag *tag = f.tag();