#include <lib/base/init_num.h>
#include <lib/base/init.h>
#include <gst/gst.h>
+#include <gst/pbutils/missing-plugins.h>
#include <sys/stat.h>
/* for subtitles */
#include <lib/gui/esubtitle.h>
extensions.push_back("mkv");
extensions.push_back("avi");
extensions.push_back("dat");
+ extensions.push_back("flac");
sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
}
case sTracknumber:
case sGenre:
case sVideoType:
+ case sTimeCreate:
+ case sUser+12:
return resIsString;
case sCurrentTitle:
tag = GST_TAG_TRACK_NUMBER;
std::string eServiceMP3::getInfoString(int w)
{
+ if ( !m_stream_tags )
+ return "";
gchar *tag = 0;
switch (w)
{
case sVideoType:
tag = GST_TAG_VIDEO_CODEC;
break;
+ case sTimeCreate:
+ GDate *date;
+ if (gst_tag_list_get_date(m_stream_tags, GST_TAG_DATE, &date))
+ {
+ gchar res[5];
+ g_date_strftime (res, sizeof(res), "%Y", date);
+ return (std::string)res;
+ }
+ break;
+ case sUser+12:
+ return m_error_message;
default:
return "";
}
-
- if (!m_stream_tags || !tag)
+ if ( !tag )
return "";
-
gchar *value;
-
if (gst_tag_list_get_string(m_stream_tags, tag, &value))
{
std::string res = value;
g_free(value);
return res;
}
-
return "";
}
audio.type = gstCheckAudioPad(str);
m_audioStreams.push_back(audio);
}
+
+ gst_tag_list_free(tags);
+ m_event((iPlayableService*)this, evUpdatedInfo);
break;
}
case GST_MESSAGE_ASYNC_DONE:
}
}
}
+ case GST_MESSAGE_ELEMENT:
+ {
+ if ( gst_is_missing_plugin_message(msg) )
+ {
+ gchar *description = gst_missing_plugin_message_get_description(msg);
+ if ( description )
+ {
+ m_error_message = description;
+ g_free(description);
+ m_event((iPlayableService*)this, evUser+12);
+ }
+ }
+ }
default:
break;
}