summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-20 18:58:22 +0100
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-20 18:58:22 +0100
commit0e077a1ed82ca9bfb8e6f234f53bbb44400df86a (patch)
treea0c5e07fecfcbd3c1bede4e366fca8120ec67116
parentb1da63ac6cae0f99b351cfa86e75c8b0b9f5442b (diff)
downloadskin-flatplus-0e077a1ed82ca9bfb8e6f234f53bbb44400df86a.tar.gz
skin-flatplus-0e077a1ed82ca9bfb8e6f234f53bbb44400df86a.tar.bz2
fix femon receiver - do not get data from previous channel
-rw-r--r--HISTORY1
-rw-r--r--displaychannel.c57
-rw-r--r--femonreceiver.c4
3 files changed, 45 insertions, 17 deletions
diff --git a/HISTORY b/HISTORY
index 7f2cc40b..2691fe2e 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2,6 +2,7 @@ VDR Plugin 'skinflatplus' Revision History
---------------------------------------
2014-MM-DD: Version 0.5.0
+- [fix] femon receiver - do not get data from previous channel
- [add] main menu widgets
- there are several widgets that can be displayed in the main menu
- Widget weather
diff --git a/displaychannel.c b/displaychannel.c
index 488ff3d1..ee4ce3e9 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -89,6 +89,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) : m_Receiver(NULL) {
bitrateVideo = bitrateAudio = bitrateDolby = 0.0;
m_Receiver = NULL;
+ /*
if( Config.ChannelBitrateShow ) {
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
@@ -97,7 +98,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) : m_Receiver(NULL) {
cDevice::ActualDevice()->AttachReceiver(m_Receiver);
}
}
-
+ */
if( Config.ChannelWeatherShow )
DrawWidgetWeather();
@@ -573,23 +574,36 @@ void cFlatDisplayChannel::BitrateDraw(void) {
delete BitrateFont;
}
+// Indicates a channel switch on the given DVB device.
+// If ChannelNumber is 0, this is before the channel is being switched,
+// otherwise ChannelNumber is the number of the channel that has been switched to.
+// LiveView tells whether this channel switch is for live viewing.
void cFlatDisplayChannel::ChannelSwitch(const cDevice * device, int channelNumber, bool liveView)
{
- if( !Config.ChannelBitrateShow )
+ if( liveView == false) // ChannelSwitch from EPG-Scan, streamdev or other?
+ return;
+ if( channelNumber == 0 ) { // before the channel is being switched -> remove receiver
+ if (m_Receiver) {
+ //dsyslog("ChannelSwitch: Receiver REMOVE");
+ m_Receiver->Deactivate();
+ DELETENULL(m_Receiver);
+ }
return;
+ }
+ // at this point we finally switch to a new channel on liveView
bitrateVideo = bitrateAudio = bitrateDolby = 0.0;
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
- if (!liveView || !channelNumber || !channel || channel->Number() != channelNumber)
- return;
+ if( channel && Config.ChannelBitrateShow && doOutput ) {
+ if ( m_Receiver ) { // this should not be happen!!!
+ //dsyslog("ChannelSwitch: Receiver is still Active -> remove it!");
+ m_Receiver->Deactivate();
+ DELETENULL(m_Receiver);
+ }
+ //dsyslog("ChannelSwitch: Receiver ATTACH %d - %s", cDevice::PrimaryDevice()->DeviceNumber(), channel->Name());
- if (m_Receiver) {
- m_Receiver->Deactivate();
- DELETENULL(m_Receiver);
- }
- if (channel) {
m_Receiver = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(m_Receiver);
}
@@ -597,17 +611,20 @@ void cFlatDisplayChannel::ChannelSwitch(const cDevice * device, int channelNumbe
void cFlatDisplayChannel::SetAudioTrack(int Index, const char * const *Tracks)
{
- if( !Config.ChannelBitrateShow )
- return;
-
bitrateVideo = bitrateAudio = bitrateDolby = 0.0;
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
- if (m_Receiver) {
+ if( m_Receiver ) {
+ dsyslog("SetAudioTrack: Receiver remove");
m_Receiver->Deactivate();
DELETENULL(m_Receiver);
}
+
+ if( !Config.ChannelBitrateShow )
+ return;
+
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
- if (channel) {
+ if( channel && doOutput ) {
+ dsyslog("SetAudioTrack: Receiver attach - %s", channel->Name());
m_Receiver = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(m_Receiver);
}
@@ -637,7 +654,17 @@ void cFlatDisplayChannel::Flush(void) {
}
}
- if( Config.ChannelBitrateShow ) {
+ if( Config.ChannelBitrateShow && doOutput && !m_Receiver ) {
+ const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
+ eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
+ if( channel ) {
+ //dsyslog("ChannelSwitch: Receiver ATTACH %d - %s FLUSH", cDevice::PrimaryDevice()->DeviceNumber(), channel->Name());
+ m_Receiver = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
+ cDevice::ActualDevice()->AttachReceiver(m_Receiver);
+ }
+ }
+
+ if( Config.ChannelBitrateShow && m_Receiver ) {
bitrateVideo = m_Receiver->VideoBitrate();
bitrateAudio = m_Receiver->AudioBitrate();
bitrateDolby = m_Receiver->AC3Bitrate();
diff --git a/femonreceiver.c b/femonreceiver.c
index 19b12406..dc1b7d2d 100644
--- a/femonreceiver.c
+++ b/femonreceiver.c
@@ -9,8 +9,8 @@
#include "femonreceiver.h"
cFemonReceiver::cFemonReceiver(const cChannel *Channel, int ATrack, int DTrack)
- : cReceiver(Channel),
- cThread("femon receiver"),
+ : cReceiver(Channel, MINPRIORITY+5),
+ cThread("flatPlus receiver"),
m_Mutex(),
m_Sleep(),
m_Active(false),