+ }
+ else
+ {
+ gdouble value = 0.0;
+ gst_tag_list_get_double(m_stream_tags, tag, &value);
+ return PyFloat_FromDouble(value);
+ }
+
+ return 0;
+}
+
+RESULT eServiceMP3::audioChannel(ePtr<iAudioChannelSelection> &ptr)
+{
+ ptr = this;
+ return 0;
+}
+
+RESULT eServiceMP3::audioTracks(ePtr<iAudioTrackSelection> &ptr)
+{
+ ptr = this;
+ return 0;
+}
+
+RESULT eServiceMP3::subtitle(ePtr<iSubtitleOutput> &ptr)
+{
+ ptr = this;
+ return 0;
+}
+
+int eServiceMP3::getNumberOfTracks()
+{
+ return m_audioStreams.size();
+}
+
+int eServiceMP3::getCurrentTrack()
+{
+ if (m_currentAudioStream == -1)
+ g_object_get (G_OBJECT (m_gst_playbin), "current-audio", &m_currentAudioStream, NULL);
+ return m_currentAudioStream;
+}
+
+RESULT eServiceMP3::selectTrack(unsigned int i)
+{
+ pts_t ppos;
+ getPlayPosition(ppos);
+ ppos -= 90000;
+ if (ppos < 0)
+ ppos = 0;
+
+ int ret = selectAudioStream(i);
+ if (!ret) {
+ /* flush */
+ seekTo(ppos);
+ }
+
+ return ret;
+}
+
+int eServiceMP3::selectAudioStream(int i)
+{
+ int current_audio;
+ g_object_set (G_OBJECT (m_gst_playbin), "current-audio", i, NULL);
+ g_object_get (G_OBJECT (m_gst_playbin), "current-audio", ¤t_audio, NULL);
+ if ( current_audio == i )
+ {
+ eDebug ("eServiceMP3::switched to audio stream %i", current_audio);
+ m_currentAudioStream = i;
+ return 0;
+ }
+ return -1;
+}
+
+int eServiceMP3::getCurrentChannel()
+{
+ return STEREO;
+}
+
+RESULT eServiceMP3::selectChannel(int i)
+{
+ eDebug("eServiceMP3::selectChannel(%i)",i);
+ return 0;
+}
+
+RESULT eServiceMP3::getTrackInfo(struct iAudioTrackInfo &info, unsigned int i)
+{
+ if (i >= m_audioStreams.size())
+ return -2;
+ info.m_description = m_audioStreams[i].codec;
+/* if (m_audioStreams[i].type == atMPEG)
+ info.m_description = "MPEG";
+ else if (m_audioStreams[i].type == atMP3)
+ info.m_description = "MP3";
+ else if (m_audioStreams[i].type == atAC3)
+ info.m_description = "AC3";
+ else if (m_audioStreams[i].type == atAAC)
+ info.m_description = "AAC";
+ else if (m_audioStreams[i].type == atDTS)
+ info.m_description = "DTS";
+ else if (m_audioStreams[i].type == atPCM)
+ info.m_description = "PCM";
+ else if (m_audioStreams[i].type == atOGG)
+ info.m_description = "OGG";
+ else if (m_audioStreams[i].type == atFLAC)
+ info.m_description = "FLAC";
+ else
+ info.m_description = "???";*/
+ if (info.m_language.empty())
+ info.m_language = m_audioStreams[i].language_code;
+ return 0;
+}