aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>2008-10-18 20:31:57 +0000
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>2008-10-18 20:31:57 +0000
commit69933717a48409574f6bcd0611f07b9f86611179 (patch)
treec1aa339b9d0e36a3e7944c0ffad2b3b87ac0be74 /lib
parent44c32e4101acdeb6df3833f35e9c0719e993a2a5 (diff)
downloadenigma2-69933717a48409574f6bcd0611f07b9f86611179.tar.gz
enigma2-69933717a48409574f6bcd0611f07b9f86611179.zip
emit evUpdatedInfo on id3 taglist parse and implement YEAR tag
Diffstat (limited to 'lib')
-rw-r--r--lib/python/Plugins/Extensions/MediaPlayer/plugin.py2
-rw-r--r--lib/service/servicemp3.cpp21
2 files changed, 17 insertions, 6 deletions
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
index afb8772e..c751bb0d 100644
--- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
@@ -244,7 +244,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
sAlbum = currPlay.info().getInfoString(iServiceInformation.sAlbum)
sGenre = currPlay.info().getInfoString(iServiceInformation.sGenre)
sArtist = currPlay.info().getInfoString(iServiceInformation.sArtist)
- sYear = ""
+ sYear = currPlay.info().getInfoString(iServiceInformation.sTimeCreate)
if sTitle == "":
if not self.isAudioCD:
diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp
index a738a5a8..225d90f6 100644
--- a/lib/service/servicemp3.cpp
+++ b/lib/service/servicemp3.cpp
@@ -681,6 +681,7 @@ int eServiceMP3::getInfo(int w)
case sTracknumber:
case sGenre:
case sVideoType:
+ case sTimeCreate:
case sUser+12:
return resIsString;
case sCurrentTitle:
@@ -706,6 +707,8 @@ int eServiceMP3::getInfo(int w)
std::string eServiceMP3::getInfoString(int w)
{
+ if ( !m_stream_tags )
+ return "";
gchar *tag = 0;
switch (w)
{
@@ -730,24 +733,29 @@ std::string eServiceMP3::getInfoString(int 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 "";
}
@@ -918,6 +926,9 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg)
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: