diff options
author | Ulrich Eckhardt <vdr@uli-eckhardt.de> | 2017-04-23 16:16:20 +0200 |
---|---|---|
committer | Ulrich Eckhardt <vdr@uli-eckhardt.de> | 2017-04-23 16:16:20 +0200 |
commit | 9f092c80185cf394b10b431942715692601e34ec (patch) | |
tree | a19c6d1449c25116ae484f8edd92163ca389e309 | |
parent | da98c3799f3e131a921cf672676b9192cd3a3a7b (diff) | |
download | vdr-plugin-radio-9f092c80185cf394b10b431942715692601e34ec.tar.gz vdr-plugin-radio-9f092c80185cf394b10b431942715692601e34ec.tar.bz2 |
Compiles with VDR 2.3.x1.0.1
-rwxr-xr-x[-rw-r--r--] | radio.c | 18 | ||||
-rwxr-xr-x[-rw-r--r--] | radioaudio.c | 13 | ||||
-rwxr-xr-x[-rw-r--r--] | radioaudio.h | 4 |
3 files changed, 30 insertions, 5 deletions
@@ -20,7 +20,7 @@ #error This version of radio-plugin requires vdr >= 1.7.37 #endif -static const char *VERSION = "1.0.0"; +static const char *VERSION = "1.0.1"; static const char *DESCRIPTION = trNOOP("Radio Background-Image/RDS-Text"); static const char *MAINMENUENTRY = trNOOP("Show RDS-Radiotext"); char *ConfigDir; @@ -136,7 +136,12 @@ void cRadioCheck::Action(void) if (chan->Vpid()) { isyslog("radio: channnel '%s' got Vpid= %d", chan->Name(), chan->Vpid()); IsRadioOrReplay = 0; +#if VDRVERSNUM >= 20300 + LOCK_CHANNELS_READ + Channels->SwitchTo(cDevice::CurrentChannel()); +#else Channels.SwitchTo(cDevice::CurrentChannel()); +#endif //cDevice::PrimaryDevice()->SwitchChannel(chan, true); } else { @@ -146,8 +151,14 @@ void cRadioCheck::Action(void) // Kanal-EPG PresentEvent if (chan->Apid(0) > 0 && (chtid == PREMIERERADIO_TID || chtid == KDRADIO_TID || chtid == UMRADIO_TID1 || chtid == UMRADIO_TID2 || chtid == UMRADIO_TID3 || chtid == UMRADIO_TID4 || chtid == UMRADIO_TID5)) { +#if VDRVERSNUM >= 20300 + LOCK_SCHEDULES_READ + static cStateKey SchedulesStateKey; + const cSchedules *scheds = cSchedules::GetSchedulesRead(SchedulesStateKey); +#else cSchedulesLock schedLock; const cSchedules *scheds = cSchedules::Schedules(schedLock); +#endif if (scheds != NULL) { const cSchedule *sched = scheds->GetSchedule(chan->GetChannelID()); if (sched != NULL) { @@ -660,7 +671,12 @@ void cPluginRadio::ChannelSwitch(const cDevice *Device, int ChannelNumber, bool char *image; if (cDevice::CurrentChannel() == ChannelNumber) { +#if VDRVERSNUM >= 20300 + LOCK_CHANNELS_READ + chan = ChannelNumber ? Channels->GetByNumber(ChannelNumber) : NULL; +#else chan = ChannelNumber ? Channels.GetByNumber(ChannelNumber) : NULL; +#endif if (chan != NULL && chan->Vpid() == 0 && chan->Apid(0) > 0) { asprintf(&image, "%s/%s.mpg", ConfigDir, chan->Name()); if (!file_exists(image)) { diff --git a/radioaudio.c b/radioaudio.c index 8c6a2dc..2bd33ef 100644..100755 --- a/radioaudio.c +++ b/radioaudio.c @@ -274,7 +274,7 @@ cRDSReceiver::~cRDSReceiver() dsyslog("radio: additional RDS-Receiver stopped"); } -void cRDSReceiver::Receive(uchar *Data, int Length) +void cRDSReceiver::Receive(const uchar *Data, int Length) { const int mframel = 263; // max. 255(MSG)+4(ADD/SQC/MFL)+2(CRC)+2(Start/Stop) of RDS-data static unsigned char mtext[mframel+1]; @@ -431,6 +431,10 @@ cRadioAudio::cRadioAudio() : cAudio() , enabled(false) , first_packets(0) + , audiopid(0) + , bratefound(false) + , rdsdevice(NULL) + , bitrate(NULL) { RadioAudio = this; dsyslog("radio: new cRadioAudio"); @@ -635,6 +639,7 @@ void cRadioAudio::RadiotextCheckPES(const uchar *data, int len) tmc[i-7] = mtext[i]; tmc_parser(tmc, i-6); } + break; } } } @@ -1179,7 +1184,7 @@ void cRadioAudio::RassDecode(unsigned char *mtext, int len) printf("Rass-Error: Length=0 or not correct (MFL= %d, MEL= %d)\n", mtext[4], mtext[6]); return; } - // byte 7+8 = Service-ID zugehöriger Datenkanal + // byte 7+8 = Service-ID zugehöriger Datenkanal // byte 9-11 = Nummer aktuelles Paket, <PNR> uint plfd = mtext[11] | mtext[10]<<8 | mtext[9]<<16; // byte 12-14 = Anzahl Pakete, <NOP> @@ -1193,7 +1198,7 @@ void cRadioAudio::RassDecode(unsigned char *mtext, int len) slidenumr = mtext[20] | mtext[19]<<8; // byte 21+22 = Element-Nummer im Slide, <INR> slideelem = mtext[22] | mtext[21]<<8; - // byte 23 = Slide-Steuerbyte, <Cntrl-Byte>: bit0 = Anzeige, bit1 = Speichern, bit2 = DarfAnzeige bei Senderwechsel, bit3 = Löschen + // byte 23 = Slide-Steuerbyte, <Cntrl-Byte>: bit0 = Anzeige, bit1 = Speichern, bit2 = DarfAnzeige bei Senderwechsel, bit3 = Löschen slideshow = mtext[23] & 0x01; slidesave = mtext[23] & 0x02; slidecan = mtext[23] & 0x04; @@ -1205,7 +1210,7 @@ void cRadioAudio::RassDecode(unsigned char *mtext, int len) printf("Rass-Error: Filetype '%d' unknown !\n", filetype); //return; } - // byte 25-28 = Dateilänge, <Item-Length> + // byte 25-28 = Dateilänge, <Item-Length> filemax = mtext[28] | mtext[27]<<8 | mtext[26]<<16 | mtext[25]<<24; if (filemax >= 65536) { if ((S_Verbose & 0x0f) >= 1) diff --git a/radioaudio.h b/radioaudio.h index 90c9cae..ab35307 100644..100755 --- a/radioaudio.h +++ b/radioaudio.h @@ -81,7 +81,11 @@ private: bool rt_start; bool rt_bstuff; protected: +#if VDRVERSNUM >= 20300 + virtual void Receive(const uchar *Data, int Length); +#else virtual void Receive(uchar *Data, int Length); +#endif public: cRDSReceiver(int Pid); virtual ~cRDSReceiver(void); |