Merge branch '2_5_to_2_6_bug_107' 2.6.0
authorghost <andreas.monzner@multimedia-labs.de>
Mon, 2 Nov 2009 15:00:05 +0000 (16:00 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Mon, 2 Nov 2009 15:00:05 +0000 (16:00 +0100)
data/setup.xml
lib/dvb/frontend.cpp
lib/dvb/idvb.h
lib/dvb/sec.cpp
lib/dvb/sec.h
lib/python/Screens/InfoBar.py
lib/python/Screens/InfoBarGenerics.py
lib/service/servicemp3.cpp
lib/service/servicemp3.h

index fe91ba25ab6e688dc4f655b0f107542e2fe87a54..22705f0bfa93ec67dffb3b78674fb6612301336b 100644 (file)
                        <item level="0" text="Brightness">config.lcd.bright</item>
                        <item level="0" text="Contrast">config.lcd.contrast</item>
                        <item level="0" text="Standby">config.lcd.standby</item>
-                       <item level="2" text="Invert display">config.lcd.invert</item>
                </setup>
                <setup key="satconfig" title="Sat / Dish Setup">
                        <item text="Tuner Slot">config.sat.tunerslot</item>
index c6bf6aa83efe4fba3c9b3dc4c8ddcf3375bbebb5..c0263fb4024daf1b43d5e91e3f0bf7e5b5fbb85e 100644 (file)
@@ -604,7 +604,7 @@ int eDVBFrontend::closeFrontend(bool force)
                setVoltage(iDVBFrontend::voltageOff);
                m_tuneTimer->stop();
                if (m_sec && !m_simulate)
-                       m_sec->setRotorMoving(false);
+                       m_sec->setRotorMoving(m_slotid, false);
                if (!::close(m_fd))
                        m_fd=-1;
                else
@@ -1694,12 +1694,12 @@ void eDVBFrontend::tuneLoop()  // called by m_tuneTimer
                                break;
                        case eSecCommand::SET_ROTOR_MOVING:
                                if (!m_simulate)
-                                       m_sec->setRotorMoving(true);
+                                       m_sec->setRotorMoving(m_slotid, true);
                                ++m_sec_sequence.current();
                                break;
                        case eSecCommand::SET_ROTOR_STOPPED:
                                if (!m_simulate)
-                                       m_sec->setRotorMoving(false);
+                                       m_sec->setRotorMoving(m_slotid, false);
                                ++m_sec_sequence.current();
                                break;
                        case eSecCommand::IF_INPUTPOWER_DELTA_GOTO:
@@ -2344,7 +2344,7 @@ RESULT eDVBFrontend::tune(const iDVBFrontendParameters &where)
                        goto tune_error;
                }
                if (!m_simulate)
-                       m_sec->setRotorMoving(false);
+                       m_sec->setRotorMoving(m_slotid, false);
                res=prepare_sat(feparm, timeout);
                if (res)
                        goto tune_error;
index 26ab5e533e8cc4158fb6290f2af5343c56ca0c04..cff4dbb97e0c6a24eaf3e40c80fe1389878d4ff9 100644 (file)
@@ -490,7 +490,7 @@ class iDVBSatelliteEquipmentControl: public iObject
 public:
        virtual RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id, unsigned int timeout)=0;
        virtual int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *fe, int frontend_id, int *highest_score_lnb=0)=0;
-       virtual void setRotorMoving(bool)=0;
+       virtual void setRotorMoving(int slotid, bool)=0;
 };
 
 struct eDVBCIRouting
index c06c603addad45581be4004b34e31827ec4b95e0..9124688950af12d3a2060da4c9e1f72375796ace 100644 (file)
@@ -37,7 +37,7 @@ void eDVBSatelliteEquipmentControl::setParam(int param, int value)
 }
 
 eDVBSatelliteEquipmentControl::eDVBSatelliteEquipmentControl(eSmartPtrList<eDVBRegisteredFrontend> &avail_frontends, eSmartPtrList<eDVBRegisteredFrontend> &avail_simulate_frontends)
-       :m_lnbidx((sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters))-1), m_curSat(m_lnbs[0].m_satellites.end()), m_avail_frontends(avail_frontends), m_avail_simulate_frontends(avail_simulate_frontends), m_rotorMoving(false)
+       :m_lnbidx((sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters))-1), m_curSat(m_lnbs[0].m_satellites.end()), m_avail_frontends(avail_frontends), m_avail_simulate_frontends(avail_simulate_frontends), m_rotorMoving(0)
 {
        if (!instance)
                instance = this;
@@ -1481,7 +1481,10 @@ bool eDVBSatelliteEquipmentControl::isRotorMoving()
        return m_rotorMoving;
 }
 
-void eDVBSatelliteEquipmentControl::setRotorMoving(bool b)
+void eDVBSatelliteEquipmentControl::setRotorMoving(int slot_no, bool b)
 {
-       m_rotorMoving=b;
+       if (b)
+               m_rotorMoving |= (1 << slot_no);
+       else
+               m_rotorMoving &= ~(1 << slot_no);
 }
index 5d96932870e7b7a0fca3a64bd4a2c7b16a5988cc..c50aee4d381c28dcb9712cb064efda508790e97b 100644 (file)
@@ -298,7 +298,7 @@ private:
        int m_lnbidx; // current index for set parameters
        std::map<int, eDVBSatelliteSwitchParameters>::iterator m_curSat;
        eSmartPtrList<eDVBRegisteredFrontend> &m_avail_frontends, &m_avail_simulate_frontends;
-       bool m_rotorMoving;
+       int m_rotorMoving;
        int m_not_linked_slot_mask;
        bool m_canMeasureInputPower;
 #endif
@@ -359,7 +359,7 @@ public:
        RESULT setTunerDepends(int from, int to);
        void setSlotNotLinked(int tuner_no);
 
-       void setRotorMoving(bool); // called from the frontend's
+       void setRotorMoving(int, bool); // called from the frontend's
        bool isRotorMoving();
        bool canMeasureInputPower() { return m_canMeasureInputPower; }
 };
index d65eace8133ef4e0bef95d328de4c928deb8d40e..59cc21d3e956834cdab50ae797e4afc0813b24de 100644 (file)
@@ -16,7 +16,7 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \
        InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarTimeshift,  \
        InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
        InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \
-       InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport, InfoBarJobman
+       InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarJobman
 
 profile("LOAD:InitBar_Components")
 from Components.ActionMap import HelpableActionMap
@@ -32,7 +32,7 @@ class InfoBar(InfoBarBase, InfoBarShowHide,
        HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
        InfoBarSubserviceSelection, InfoBarTimeshift, InfoBarSeek,
        InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions,
-       InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport, InfoBarJobman,
+       InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarServiceErrorPopupSupport, InfoBarJobman,
        Screen):
        
        ALLOW_SUSPEND = True
@@ -56,7 +56,7 @@ class InfoBar(InfoBarBase, InfoBarShowHide,
                                InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
                                InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
                                InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarJobman, \
-                               InfoBarSleepTimer, InfoBarPlugins, InfoBarServiceErrorPopupSupport:
+                               InfoBarPlugins, InfoBarServiceErrorPopupSupport:
                        x.__init__(self)
 
                self.helpList.append((self["actions"], "InfobarActions", [("showMovies", _("view recordings..."))]))
index 2f8306164ccbe42ed2b8dfca6675372eb77e71bc..2cbfeb733819faceecff80e23feecbe0982297a9 100644 (file)
@@ -24,7 +24,6 @@ from Screens.TimerSelection import TimerSelection
 from Screens.PictureInPicture import PictureInPicture
 from Screens.SubtitleDisplay import SubtitleDisplay
 from Screens.RdsDisplay import RdsInfoDisplay, RassInteractive
-from Screens.SleepTimerEdit import SleepTimerEdit
 from Screens.TimeDateInput import TimeDateInput
 from ServiceReference import ServiceReference
 
@@ -1356,17 +1355,6 @@ class InfoBarJobman:
        def JobViewCB(self, in_background):
                job_manager.in_background = in_background
 
-# depends on InfoBarExtensions
-class InfoBarSleepTimer:
-       def __init__(self):
-               self.addExtension((self.getSleepTimerName, self.showSleepTimerSetup, lambda: True), "1")
-
-       def getSleepTimerName(self):
-               return _("Sleep Timer")
-
-       def showSleepTimerSetup(self):
-               self.session.open(SleepTimerEdit)
-
 # depends on InfoBarExtensions
 class InfoBarPiP:
        def __init__(self):
index af9e1d34a52725b2f270b1b4f170b6cc3285cccb..e1bf23dd8482f83106783cdfa014b83b649d77f4 100644 (file)
@@ -193,7 +193,7 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
        m_seekTimeout = eTimer::create(eApp);
        m_subtitle_sync_timer = eTimer::create(eApp);
        m_stream_tags = 0;
-       m_currentAudioStream = 0;
+       m_currentAudioStream = -1;
        m_currentSubtitleStream = 0;
        m_subtitle_widget = 0;
        m_currentTrickRatio = 0;
@@ -301,7 +301,7 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
                eDebug("eServiceMP3::sorry, can't play: missing gst-plugin-appsink");
        else
        {
-               g_signal_connect (subsink, "new-buffer", G_CALLBACK (gstCBsubtitleAvail), this);
+               m_subs_to_pull_handler_id = g_signal_connect (subsink, "new-buffer", G_CALLBACK (gstCBsubtitleAvail), this);
                g_object_set (G_OBJECT (m_gst_playbin), "text-sink", subsink, NULL);
        }
 
@@ -334,16 +334,28 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
                m_gst_playbin = 0;
        }
 
-       gst_element_set_state (m_gst_playbin, GST_STATE_PLAYING);
        setBufferSize(m_buffer_size);
 }
 
 eServiceMP3::~eServiceMP3()
 {
+       // disconnect subtitle callback
+       GstElement *sink;
+       g_object_get (G_OBJECT (m_gst_playbin), "text-sink", &sink, NULL);
+       if (sink)
+       {
+               g_signal_handler_disconnect (sink, m_subs_to_pull_handler_id);
+               gst_object_unref(sink);
+       }
+
        delete m_subtitle_widget;
+
+       // disconnect sync handler callback
+       gst_bus_set_sync_handler(gst_pipeline_get_bus (GST_PIPELINE (m_gst_playbin)), NULL, NULL);
+
        if (m_state == stRunning)
                stop();
-       
+
        if (m_stream_tags)
                gst_tag_list_free(m_stream_tags);
        
@@ -354,7 +366,7 @@ eServiceMP3::~eServiceMP3()
        }
 }
 
-DEFINE_REF(eServiceMP3);       
+DEFINE_REF(eServiceMP3);
 
 RESULT eServiceMP3::connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)
 {
@@ -365,25 +377,30 @@ RESULT eServiceMP3::connectEvent(const Slot2<void,iPlayableService*,int> &event,
 RESULT eServiceMP3::start()
 {
        ASSERT(m_state == stIdle);
-       
+
        m_state = stRunning;
        if (m_gst_playbin)
        {
                eDebug("eServiceMP3::starting pipeline");
                gst_element_set_state (m_gst_playbin, GST_STATE_PLAYING);
        }
+
        m_event(this, evStart);
+
        return 0;
 }
 
 RESULT eServiceMP3::stop()
 {
        ASSERT(m_state != stIdle);
+
        if (m_state == stStopped)
                return -1;
+
        eDebug("eServiceMP3::stop %s", m_ref.path.c_str());
        gst_element_set_state(m_gst_playbin, GST_STATE_NULL);
        m_state = stStopped;
+
        return 0;
 }
 
@@ -944,6 +961,8 @@ int eServiceMP3::getNumberOfTracks()
 
 int eServiceMP3::getCurrentTrack()
 {
+       if (m_currentAudioStream == -1)
+               g_object_get (G_OBJECT (m_gst_playbin), "current-audio", &m_currentAudioStream, NULL);
        return m_currentAudioStream;
 }
 
index d2a8fb0bf0de79ef0032b917cc02c4711e48ecaa..15ed0b077b0448e6ec41e5e574c6fa5ded862a13 100644 (file)
@@ -204,6 +204,7 @@ private:
        void pullSubtitle();
        int m_subs_to_pull;
        eSingleLock m_subs_to_pull_lock;
+       gulong m_subs_to_pull_handler_id;
 
        RESULT seekToImpl(pts_t to);