show warning message when trying to play video container with DTS stream (requires...
authorFraxinas <andreas.frisch@multimedia-labs.de>
Mon, 23 Feb 2009 14:42:59 +0000 (15:42 +0100)
committerFraxinas <andreas.frisch@multimedia-labs.de>
Mon, 23 Feb 2009 14:42:59 +0000 (15:42 +0100)
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
lib/service/servicemp3.cpp

index 3e02384122a8826c0f9f820abf57017f1ddee89f..e81750ba94a698d682a4e40577fc112b5a698c45 100644 (file)
@@ -224,7 +224,8 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
                        {
                                iPlayableService.evUpdatedInfo: self.__evUpdatedInfo,
-                               iPlayableService.evUser+11: self.__evDecodeError,
+                               iPlayableService.evUser+10: self.__evAudioDecodeError,
+                               iPlayableService.evUser+11: self.__evVideoDecodeError,
                                iPlayableService.evUser+12: self.__evPluginError,
                                iPlayableService.evUser+13: self["coverArt"].embeddedCoverArt
                        })
@@ -268,11 +269,17 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                print "[__evUpdatedInfo] title %d of %d (%s)" % (currenttitle, totaltitles, sTitle)
                self.readTitleInformation()
 
-       def __evDecodeError(self):
+       def __evAudioDecodeError(self):
+               currPlay = self.session.nav.getCurrentService()
+               sAudioType = currPlay.info().getInfoString(iServiceInformation.sUser+10)
+               print "[__evAudioDecodeError] audio-codec %s can't be decoded by hardware" % (sAudioType)
+               self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sAudioType, type = MessageBox.TYPE_INFO,timeout = 20 )
+
+       def __evVideoDecodeError(self):
                currPlay = self.session.nav.getCurrentService()
                sVideoType = currPlay.info().getInfoString(iServiceInformation.sVideoType)
-               print "[__evDecodeError] video-codec %s can't be decoded by hardware" % (sVideoType)
-               self.session.open(MessageBox, _("This Dreambox can't decode %s video streams!") % sVideoType, type = MessageBox.TYPE_INFO,timeout = 20 )
+               print "[__evVideoDecodeError] video-codec %s can't be decoded by hardware" % (sVideoType)
+               self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sVideoType, type = MessageBox.TYPE_INFO,timeout = 20 )
 
        def __evPluginError(self):
                currPlay = self.session.nav.getCurrentService()
index bbcb3b5cf061ea165673a79609a38d6ddb769abd..d90186a58be108870fab3a4ffaa4a864023a071a 100644 (file)
@@ -838,6 +838,7 @@ int eServiceMP3::getInfo(int w)
        case sGenre:
        case sVideoType:
        case sTimeCreate:
+       case sUser+10:
        case sUser+12:
                return resIsString;
        case sCurrentTitle:
@@ -886,6 +887,9 @@ std::string eServiceMP3::getInfoString(int w)
        case sGenre:
                tag = GST_TAG_GENRE;
                break;
+       case sUser+10:
+               tag = GST_TAG_AUDIO_CODEC;
+               break;
        case sVideoType:
                tag = GST_TAG_VIDEO_CODEC;
                break;
@@ -1025,7 +1029,7 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg)
 
        source = GST_MESSAGE_SRC(msg);
        sourceName = gst_object_get_name(source);
-#if 0
+#if 1
        if (gst_message_get_structure(msg))
        {
                gchar *string = gst_structure_to_string(gst_message_get_structure(msg));
@@ -1050,8 +1054,13 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg)
                        eWarning("Gstreamer error: %s (%i) from %s", err->message, err->code, sourceName );
                        if ( err->domain == GST_STREAM_ERROR )
                        {
-                               if ( err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND && g_strrstr(sourceName, "videosink") )
-                                       m_event((iPlayableService*)this, evUser+11);
+                               if ( err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND )
+                               {
+                                       if ( g_strrstr(sourceName, "videosink") )
+                                               m_event((iPlayableService*)this, evUser+11);
+                                       else if ( g_strrstr(sourceName, "audiosink") )
+                                               m_event((iPlayableService*)this, evUser+10);
+                               }
                                else if ( err->code == GST_STREAM_ERROR_FAILED && g_strrstr(sourceName, "file-source") )
                                {
                                        eWarning("error in tag parsing, linking mp3parse directly to file-sink, bypassing id3demux...");