]> git.vomp.tv Git - vompclient.git/commitdiff
Add audio types to protocol, add aac decoding, extract language codes from TS and...
authorMarten Richter <marten.richter@freenet.de>
Sat, 27 Oct 2012 17:51:17 +0000 (19:51 +0200)
committerMarten Richter <marten.richter@freenet.de>
Sat, 27 Oct 2012 17:51:17 +0000 (19:51 +0200)
25 files changed:
audio.h
audioomx.cc
audioomx.h
audiowin.h
channel.cc
channel.h
demuxer.cc
demuxer.h
demuxerts.cc
demuxerts.h
draintarget.h
player.cc
player.h
playerlive.h
playerliveradio.cc
playerliveradio.h
playerlivetv.cc
playerlivetv.h
vaudioselector.cc
vaudioselector.h
vconnect.cc
vdr.cc
vdr.h
vvideolivetv.cc
vvideorec.cc

diff --git a/audio.h b/audio.h
index ab0a213a6c40e6a2e8ed80ef71693a2d23e540fd..601c2e77e676aee927068005b5b42ba0e744ea1c 100644 (file)
--- a/audio.h
+++ b/audio.h
@@ -60,6 +60,16 @@ class Audio : public DrainTarget, public AbstractOption
     virtual int unMute()=0;\r
     virtual bool supportsAc3()=0;\r
     virtual bool maysupportAc3(){return false;}\r
+    virtual bool streamTypeSupported(int streamtype)\r
+    {\r
+       switch (streamtype) {\r
+       case 3:\r
+       case 4:\r
+               return true;\r
+       default:\r
+               return false;\r
+       };\r
+    }\r
 \r
     int volumeUp();\r
     int volumeDown();\r
index 684dee84f9545e6fccf9b80d04a8dbc92c233f65..14627d92a690651335cf83a057449b623cca8197 100644 (file)
@@ -37,11 +37,13 @@ AudioOMX::AudioOMX()
   canpass_ac3=false;
   canpass_mp2=false;
   canpass_mp3=false;
+  canpass_aac=false;
   canpass_pcm_mch=false;
 
   prefered_ac3=0; //0 stereo PCM, 1 passthrough 2 Multichannel PCM
   prefered_mp2=0;
   prefered_mp3=0;
+  prefered_aac=0;
   hdmi=true;
 
   omx_running=false;
@@ -102,6 +104,13 @@ int AudioOMX::init(UCHAR tstreamType) {
                return 0;
        }
 
+       aaclatmcodec_libav = avcodec_find_decoder(CODEC_ID_AAC_LATM);
+       if (aaclatmcodec_libav == NULL) {
+               Log::getInstance()->log("Audio", Log::DEBUG,
+                               "Find libav aac latm decoder failed");
+               return 0;
+       }
+
        int ret;
 
        ret=vc_tv_hdmi_audio_supported( EDID_AudioFormat_eMPEG1,2,EDID_AudioSampleRate_e48KHz,0);
@@ -125,6 +134,14 @@ int AudioOMX::init(UCHAR tstreamType) {
                Log::getInstance()->log("Audio", Log::NOTICE,
                                                "TV hdmi supports AC3");
        }
+       ret=vc_tv_hdmi_audio_supported( EDID_AudioFormat_eAAC,6,EDID_AudioSampleRate_e48KHz,0);
+       if (ret==0) {
+               canpass_aac=true;
+               //not implemented
+               Log::getInstance()->log("Audio", Log::NOTICE,
+                               "TV hdmi supports AAC");
+       }
+
        canpass_pcm_mch=false;
 
        return 1;
@@ -178,6 +195,18 @@ bool AudioOMX::loadOptionsfromServer(VDR* vdr)
                }
        }
 
+       name = vdr->configLoad("AudioOMX", "AACDecodingMode");
+
+       if (name != NULL) {
+               if (STRCASECMP(name, "PCM") == 0) {
+                       prefered_aac = 0;
+               } else if (STRCASECMP(name, "Passthrough") == 0) {
+                       prefered_aac = 1;
+               } else if (STRCASECMP(name, "PCMMultichannel") == 0) {
+                       prefered_aac = 2;
+               }
+       }
+
        name = vdr->configLoad("AudioOMX", "Mp3DecodingMode");
 
        if (name != NULL) {
@@ -256,6 +285,18 @@ bool AudioOMX::handleOptionChanges(Option* option)
                }
        }
                break;
+       case 5: {
+               if (STRCASECMP(option->options[option->userSetChoice], "PCM") == 0) {
+                       prefered_aac = 0;
+               } else if (STRCASECMP(option->options[option->userSetChoice],
+                               "Passthrough") == 0) {
+                       prefered_aac = 1;
+               } else if (STRCASECMP(option->options[option->userSetChoice],
+                               "PCMMultichannel") == 0) {
+                       prefered_aac = 2;
+               }
+       }
+       break;
        };
        return false;
 
@@ -278,6 +319,20 @@ bool AudioOMX::saveOptionstoServer()
                break;
        };
 
+    switch (prefered_aac) {
+       case 0:
+               VDR::getInstance()->configSave("AudioOMX", "AACDecodingMode", "PCM");
+               break;
+       case 1:
+               VDR::getInstance()->configSave("AudioOMX", "AACDecodingMode",
+                               "Passthrough");
+               break;
+       case 2:
+               VDR::getInstance()->configSave("AudioOMX", "AACDecodingMode",
+                               "PCMMultichannel");
+               break;
+       };
+
        switch (prefered_mp2) {
        case 0:
                VDR::getInstance()->configSave("AudioOMX", "Mp2DecodingMode", "PCM");
@@ -353,6 +408,28 @@ bool AudioOMX::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pa
         options->push_back(option);
         pane->addOptionLine(option);
 
+ /*       char **aacopts = new char *[3];
+        i = 0;
+        aacopts[i] = new char[strlen("PCM") + 1];
+        strcpy(mp2opts[i], "PCM");
+        i++;
+        if (canpass_aac) {
+               aacopts[i] = new char[strlen("Passthrough") + 1];
+               strcpy(aacopts[i], "PassThrough");
+               i++;
+        }
+        if (canpass_pcm_mch) {
+               aacopts[i] = new char[strlen("PCMMultichannel") + 1];
+               strcpy(aacopts[i], "PCMMultichannel");
+               i++;
+        }
+        option = new Option(5, tr("Mp2 HDMI Mode"), "AudioOMX",
+                       "AACDecodingMode", Option::TYPE_TEXT, i, 0, 0,
+                       aacopts, NULL, true, this);
+        options->push_back(option);
+        pane->addOptionLine(option);
+
+
         char **mp2opts = new char *[3];
                i = 0;
                mp2opts[i] = new char[strlen("PCM") + 1];
@@ -393,7 +470,8 @@ bool AudioOMX::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pa
                                "Mp2DecodingMode", Option::TYPE_TEXT, i, 0, 0, mp3opts,
                                NULL, true, this);
                options->push_back(option);
-               pane->addOptionLine(option);
+               pane->addOptionLine(option);*/
+        // Comment unsupported modes out
 
 
     }
@@ -525,6 +603,22 @@ int AudioOMX::ChangeAudioPortConfig(bool disport) //clock aka omx mutex needs to
                        }
                }
                        break;
+               case MPTYPE_AAC_LATM: {
+                       if (prefered_aac == 2 && false) { //not supported yet
+
+                       } else {
+                               Log::getInstance()->log("Audio", Log::DEBUG,
+                                               "ChangeAudioPortConfig debug %d %d",prefered_aac,canpass_aac);
+                               if (prefered_aac == 1 && canpass_aac) {
+                                       passthrough = true;
+                                       encoding=OMX_AUDIO_CodingAAC;
+                               } else {
+                                       passthrough = false;
+                                       encoding=OMX_AUDIO_CodingPCM;
+                               }
+                       }
+               }
+               break;
                case MPTYPE_AC3_PRE13:
                case MPTYPE_AC3: {
                        if (prefered_ac3 == 2 && false) { //not supported yet
@@ -711,6 +805,23 @@ int AudioOMX::InitDecoderLibAV()
                return 0;
        }
 
+       aaclatmcodec_context_libav = avcodec_alloc_context3(aaclatmcodec_libav);
+       if (!aaclatmcodec_context_libav) {
+               Log::getInstance()->log("Audio", Log::DEBUG, "Alloc avcodec for aac decoding context failed!");
+               return 0;
+       }
+
+       aaclatmcodec_context_libav->flags |= CODEC_FLAG_TRUNCATED;
+       aaclatmcodec_context_libav->request_channels=2;
+
+       avc_ret = avcodec_open2(aaclatmcodec_context_libav, aaclatmcodec_libav, NULL);
+       if (avc_ret < 0) {
+               Log::getInstance()->log("Audio", Log::DEBUG, "Opening libav codec  failed \n");
+               libav_mutex.Unlock();
+               return 0;
+       }
+
+
        mp23codec_context_libav = avcodec_alloc_context3(mp23codec_libav);
        if (!ac3codec_context_libav) {
                Log::getInstance()->log("Audio", Log::DEBUG, "Alloc avcodec for mp23 decoding context failed!");
@@ -746,7 +857,13 @@ void AudioOMX::DeinitDecoderLibAV() {
                avcodec_close(ac3codec_context_libav);
                av_free(ac3codec_context_libav);
                ac3codec_context_libav = NULL;
+
+               avcodec_close(aaclatmcodec_context_libav);
+               av_free(aaclatmcodec_context_libav);
+               aaclatmcodec_context_libav = NULL;
+
                av_free(decode_frame_libav);
+
                avcodec_close(mp23codec_context_libav);
                av_free(mp23codec_context_libav);
                mp23codec_context_libav = NULL;
@@ -1470,6 +1587,23 @@ unsigned int AudioOMX::AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,u
        return size;
 }
 
+unsigned int AudioOMX::AdvanceAacLatmAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize)
+{
+       if (size<=4) return size; // silly;
+       unsigned int test=0;
+       *framesize=20000; //if we do not find a start code do not decompress
+       while (test+4<size) {
+               if (data[test] ==0x56 && (data[test+1]& 0xe0)==0xe0) {
+                       // now figure out the length of the frame
+                       unsigned int length= ((0x1f & data[test+1])<<8) | data[test+2];
+                       *framesize=length;
+                       return test; // probably FrameSync
+               }
+               test++;
+       }
+       return size;
+}
+
 
 void AudioOMX::PrepareMediaSample(const MediaPacketList& mplist,UINT samplepos)
 {
@@ -1691,6 +1825,12 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer,
                                                        haveToCopy,&gotframesize);
                                }
                                break;
+
+                               case MPTYPE_AAC_LATM: {
+                                       adv = AdvanceAacLatmAudioSync(buffer+packet.pos_buffer+*samplepos,
+                                                       haveToCopy,&gotframesize);
+                               }
+                               break;
                                };
                                if (adv!=haveToCopy) {
                                        lsync=false;
@@ -1748,6 +1888,9 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer,
                        if (current_context->frame_size<0) framesize=1152; //Maximum framesize
                        else framesize=current_context->frame_size;
                }break;
+               case MPTYPE_AAC_LATM: {
+                       current_context = aaclatmcodec_context_libav;
+               } break;
                case MPTYPE_AC3:
                case MPTYPE_AC3_PRE13: {
                        current_context = ac3codec_context_libav;
@@ -1790,6 +1933,11 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer,
                                                        incoming_paket_libav.size,&gotframesize);
                                }
                                break;
+                               case MPTYPE_AAC_LATM: {
+                                       adv = AdvanceAacLatmAudioSync(incoming_paket_libav.data,
+                                                       incoming_paket_libav.size,&gotframesize);
+                               }
+                               break;
                                };
                                if (adv > 0) {
                                        incoming_paket_libav.data += adv;
index 360a09328e4c5e773481c0d3c192dbcfd6aaa4e4..30032e42198370ea9cf707e2d40b50e2f89986b5 100644 (file)
@@ -61,7 +61,20 @@ class AudioOMX : public Audio
     int mute();\r
     int unMute();\r
     bool supportsAc3() { return true; }\r
-    virtual bool maysupportAc3(){return true;}\r
+    bool maysupportAc3(){return true;}\r
+    bool streamTypeSupported(int streamtype)\r
+    {\r
+       switch (streamtype) {\r
+       case 0x11: //AAC LATM packaging\r
+       case 0x6A://ac3\r
+       case 3: //mpeg 1 layer 1 and 2\r
+       case 4:\r
+               return true;\r
+       default:\r
+               return false;\r
+       };\r
+    }\r
+\r
 \r
     //Writing Data to Audiodevice\r
     virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);\r
@@ -100,12 +113,14 @@ class AudioOMX : public Audio
     bool hdmi; // use hdmi as audio output\r
     bool passthrough; // use audio passthrough for the current audio type\r
 \r
+    bool canpass_aac;\r
     bool canpass_ac3;\r
     bool canpass_mp2;\r
     bool canpass_mp3;\r
     bool canpass_pcm_mch;\r
 \r
 \r
+    int prefered_aac;\r
     int prefered_ac3; //0 stereo PCM, 1 passthrough 2 Multichannel PCM\r
     int prefered_mp2;\r
     int prefered_mp3;\r
@@ -118,6 +133,7 @@ class AudioOMX : public Audio
 \r
 \r
        unsigned int AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize);\r
+       unsigned int AdvanceAacLatmAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize);\r
        unsigned int AdvanceMpAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize);\r
 \r
 \r
@@ -158,6 +174,8 @@ class AudioOMX : public Audio
     bool omx_first_frame;\r
     Mutex libav_mutex;\r
 \r
+    AVCodec *aaclatmcodec_libav;\r
+    AVCodecContext *aaclatmcodec_context_libav;\r
        AVCodec *ac3codec_libav;\r
        AVCodecContext *ac3codec_context_libav;\r
        AVCodec *mp23codec_libav;\r
index 69e66d8bd04f3cf87bece43cbfca10ef51a3c926..e1b087cb80c271f89f51c6af1125fec30e5d3c6f 100644 (file)
@@ -78,6 +78,20 @@ class AudioWin : public Audio
 
     virtual bool supportsAc3();
     virtual bool maysupportAc3(){return true;} // We are not sure maybe we support this, allows the player to select ac3, if there is no other option
+
+    virtual bool streamTypeSupported(int streamtype)
+    {
+       switch (streamtype) {
+       case 0x6A:
+       case 3:
+       case 4:
+               return true;
+       default:
+               return false;
+       };
+    }
+
+
   private:
     MediaPacket mediapacket;
   public:
index 8f2f5bcf5ec7a613d328f183c9a226aaab1542d1..075458154a54a93f19425d0a04addf4ef02730cc 100644 (file)
@@ -46,9 +46,6 @@ Channel::~Channel()
   if (name) delete[] name;
   index = -1; // just in case
 
-  for(ULONG i = 0; i < numAPids; i++) delete[] apids[i].name;
-  for(ULONG i = 0; i < numDPids; i++) delete[] dpids[i].name;
-  for(ULONG i = 0; i < numSPids; i++) delete[] spids[i].name;
 }
 
 void Channel::loadPids()
@@ -56,11 +53,8 @@ void Channel::loadPids()
   // Clear the list if this is a reload
   if (numAPids)
   {
-    for(ULONG i = 0; i < numAPids; i++) delete[] apids[i].name;
     apids.clear();
-    for(ULONG i = 0; i < numDPids; i++) delete[] dpids[i].name;
     dpids.clear();
-    for(ULONG i = 0; i < numSPids; i++) delete[] spids[i].name;
     spids.clear();
     vpid = 0;
     tpid = 0;
@@ -80,14 +74,14 @@ void Channel::loadPids()
       number, vpid, numAPids, numDPids, numSPids, tpid);
   for (ULONG i = 0; i < numAPids; i++)
   {
-    Log::getInstance()->log("Channel", Log::DEBUG, "APid %lu %s", apids[i].pid, apids[i].name);
+    Log::getInstance()->log("Channel", Log::DEBUG, "APid %lu %s %d", apids[i].pid, apids[i].desc,apids[i].type);
   }
   for (ULONG i = 0; i < numDPids; i++)
   {
-    Log::getInstance()->log("Channel", Log::DEBUG, "DPid %lu %s", dpids[i].pid, dpids[i].name);
+    Log::getInstance()->log("Channel", Log::DEBUG, "DPid %lu %s %d", dpids[i].pid, dpids[i].desc,dpids[i].type);
   }
   for (ULONG i = 0; i < numSPids; i++)
   {
-    Log::getInstance()->log("Channel", Log::DEBUG, "SPid %lu %s", spids[i].pid, spids[i].name);
+    Log::getInstance()->log("Channel", Log::DEBUG, "SPid %lu %s %d %d %d", spids[i].pid, spids[i].desc,spids[i].type,spids[i].data1,spids[i].data2);
   }
 }
index c3688f24545502ff8ea8948f015694df35c1f466..bb9ea8f20180dc3533f5112b19dd99db705722fc 100644 (file)
--- a/channel.h
+++ b/channel.h
@@ -32,7 +32,10 @@ using namespace std;
 typedef struct _apid
 {
   ULONG pid;
-  char* name;
+  char desc[10];
+  ULONG type;
+  ULONG data1;
+  ULONG data2;
 } apid;
 
 typedef vector<apid> APidList;
index 6aef0d134a587167d51d1c51de4fc4fcfeafa1ec..a3700bc5c1ea9b5758bd663cfbf0bf8104198679 100644 (file)
@@ -425,6 +425,7 @@ Demuxer::Demuxer()
   packetnum=0;\r
   h264 = false;\r
   fps = 25.0;\r
+  astreamtype=4;\r
 }\r
 \r
 Demuxer::~Demuxer()\r
@@ -478,6 +479,7 @@ void Demuxer::reset()
   ispre_1_3_19 = false;\r
   h264 = false;\r
   packetnum=0;\r
+  astreamtype=4;\r
 \r
   for (int i = 0; i <= (PESTYPE_AUDMAX - PESTYPE_AUD0); i++)\r
   {\r
@@ -597,7 +599,16 @@ bool Demuxer::submitPacket(PESPacket& packet)
     avail_mpaudchan[packet_type - PESTYPE_AUD0] = true;\r
     if (audio_current == packet_type && !aud_seeking)\r
        {\r
-      sent = audiostream.put(&packetdata[0], packet.getSize(), MPTYPE_MPEG_AUDIO,packetnum);\r
+      UCHAR type=MPTYPE_MPEG_AUDIO;\r
+      switch (astreamtype)\r
+      {\r
+      case 3:\r
+      case 4:\r
+         type=MPTYPE_MPEG_AUDIO; break;\r
+      case 0x11:\r
+         type=MPTYPE_AAC_LATM; break;\r
+      };\r
+      sent = audiostream.put(&packetdata[0], packet.getSize(), type,packetnum);\r
          if (sent)  packetnum++;\r
        }\r
        else\r
index b1474eebd3412a87b76d1fbdf764fc5ccecce222..2d65ea23e4e05845c6cd491d1dc7b2444403e03e 100644 (file)
--- a/demuxer.h
+++ b/demuxer.h
@@ -204,6 +204,7 @@ class Demuxer
     bool aud_seeking;\r
        bool h264;\r
     int video_current, audio_current, teletext_current, subtitle_current;\r
+    int astreamtype;\r
 \r
     // Video stream information\r
     void setAspectRatio(enum AspectRatio);\r
index def7222e2071467dc0efabe800bb6ed6eb28f189..ec83d112bbc4913f92ab6e12ebd6eb4a546059f5 100644 (file)
@@ -22,6 +22,7 @@
 #include "log.h"\r
 #include "video.h"\r
 #include "vdr.h"\r
+#include "audio.h"\r
 \r
 #define PTS_JUMP_MARGIN   10000\r
 #define PTS_ALLOWANCE 90000\r
@@ -105,10 +106,11 @@ void DemuxerTS::setVID(int p_vID)
   vActive = false;\r
 }\r
 \r
-void DemuxerTS::setAID(int p_aID, int type)\r
+void DemuxerTS::setAID(int p_aID, int type, int streamtype)\r
 {\r
   aID = p_aID;\r
   atype = type;\r
+  astreamtype = streamtype;\r
   switch (atype)\r
   {\r
   case 1:\r
@@ -395,8 +397,9 @@ int DemuxerTS::processTS(UCHAR* buf)
             {\r
                 foundpid = foundpid & 0x1FFF; //clear upper 3 bits\r
                 bool notfound=false;\r
+                bool nolang=true;\r
                 int pos=0;\r
-       //     Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDPID is %x", foundpid);\r
+           // Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDPID is %x %x", foundpid,streamtype);\r
                 switch (streamtype)\r
                 {\r
                 case 0x1B: //MPEG 4 for future use\r
@@ -412,15 +415,35 @@ int DemuxerTS::processTS(UCHAR* buf)
 \r
                 //  Log::getInstance()->log("ProcessTS", Log::DEBUG, "Set video PID to %x", foundpid);\r
                         }break;\r
+                case 0x0F: //AAC ADTS packaging\r
+                case 0x11: // LATM packaging\r
                 case 3:\r
                 case 4: { //audio\r
                     apid newapid;\r
                     newapid.pid = foundpid;\r
-                    newapid.name = NULL; //set it in player\r
+                    newapid.desc[0]=0;\r
+                    newapid.type=streamtype;\r
+                    pos=0;\r
+                    nolang=true;\r
+                    while (pos< eslength && nolang) {\r
+                       switch (buf[p+pos]) {\r
+                       case 0x0A: {\r
+                               newapid.desc[0]=buf[p+pos+2];\r
+                               newapid.desc[1]=buf[p+pos+3];\r
+                               newapid.desc[2]=buf[p+pos+4];\r
+                               newapid.desc[3]=0;\r
+                               nolang=false;\r
+                    //         Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDLANG is %s", newapid.desc);\r
+                       } break;\r
+                       };\r
+\r
+                       pos+=2+buf[p+pos+1];\r
+                    }\r
+\r
                     new_channelinfo.apids.push_back(newapid);\r
                     new_channelinfo.numAPids++;\r
-                    if (getAID() == 0) { //set unset AID to first audio pid that reports itself\r
-                        setAID(foundpid,0);\r
+                    if (getAID() == 0 && Audio::getInstance()->streamTypeSupported(streamtype)) { //set unset AID to first audio pid that reports itself\r
+                        setAID(foundpid,0,streamtype);\r
                         Log::getInstance()->log("ProcessTS", Log::DEBUG, "Set audio PID to %x", foundpid);\r
                     }\r
                         } break;\r
@@ -428,29 +451,57 @@ int DemuxerTS::processTS(UCHAR* buf)
                 case 6: { //Private Data \r
                     apid newapid;\r
                     newapid.pid = foundpid;\r
-                    newapid.name = NULL; //set it in player\r
+                    newapid.desc[0]=0; //set it in player\r
                     pos=0;\r
                     notfound=true;\r
+                    nolang=true;\r
+                    int type=0;\r
                   \r
-                    while (pos< eslength && notfound) {\r
+                    while (pos< eslength && (notfound || nolang)) {\r
                         switch (buf[p+pos]) {\r
+                        case 0x7A: // Enhanced Ac3 Desriptor\r
                         case 0x6A: {//Ac3 descriptor \r
-                            new_channelinfo.dpids.push_back(newapid);\r
-                            new_channelinfo.numDPids++;\r
+                               newapid.type=buf[p+pos];\r
+                               type=1;\r
+\r
                             notfound=false;\r
                                    } break; \r
                        case 0x59: {//SubtitlingDescriptor\r
-                            new_channelinfo.spids.push_back(newapid);\r
-                            new_channelinfo.numSPids++;\r
+                           type=2;\r
+                           newapid.type=buf[p+pos];\r
+                           newapid.desc[0]=buf[p+pos+2];\r
+                           newapid.desc[1]=buf[p+pos+3];\r
+                           newapid.desc[2]=buf[p+pos+4];\r
+                           newapid.desc[3]=0;\r
+                           newapid.data1=(buf[p+pos+5]<<8) |(buf[p+pos+6]);\r
+                           newapid.data2=(buf[p+pos+7]<<8) |(buf[p+pos+8]);\r
+                        //   Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDSUB is %s", newapid.desc);\r
                             notfound=false;\r
+                            nolang=false;\r
                                    } break;\r
+                       case 0x0A: {\r
+                          newapid.desc[0]=buf[p+pos+2];\r
+                          newapid.desc[1]=buf[p+pos+3];\r
+                          newapid.desc[2]=buf[p+pos+4];\r
+                          newapid.desc[3]=0;\r
+                          nolang=false;\r
+                        //  Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDLANG is %s", newapid.desc);\r
+                       } break;\r
                        case 0x56: {\r
+                          type=3;\r
                            new_channelinfo.tpid=foundpid;\r
                            notfound=false;\r
                                   } break;\r
                         };\r
                         pos+=2+buf[p+pos+1];\r
                     }\r
+                    if (type==1) {\r
+                       new_channelinfo.dpids.push_back(newapid);\r
+                       new_channelinfo.numDPids++;\r
+                    } else if (type==2) {\r
+                       new_channelinfo.spids.push_back(newapid);\r
+                       new_channelinfo.numSPids++;\r
+                    }\r
 \r
                         } break;\r
                 default://TODO how about subtitles and second audio pids\r
@@ -475,14 +526,33 @@ int DemuxerTS::processTS(UCHAR* buf)
             }\r
         }\r
         if (! audioPIDpresent) {\r
+               bool found=false;\r
             if (channelinfo.numAPids>0) {\r
-                setAID(channelinfo.apids[0].pid,0);\r
-            } else if (channelinfo.numDPids>0) {\r
-                setAID(channelinfo.dpids[0].pid,1);\r
+               int j=0;\r
+               while (j<channelinfo.numAPids && !found) {\r
+                       if (Audio::getInstance()->streamTypeSupported(channelinfo.apids[j].type)) {\r
+                               found =true;\r
+                               setAID(channelinfo.apids[j].pid,0,channelinfo.apids[j].type);\r
+                       }\r
+                       j++;\r
+               }\r
+\r
+            }\r
+            if (channelinfo.numDPids>0 && !found) {\r
+               int j=0;\r
+               while (j<channelinfo.numDPids && !found) {\r
+                       if (Audio::getInstance()->streamTypeSupported(channelinfo.dpids[j].type)) {\r
+                               found =true;\r
+                               setAID(channelinfo.dpids[j].pid,1,channelinfo.dpids[j].type);\r
+                       }\r
+                       i++;\r
+               }\r
             }\r
         }\r
 \r
         channelinfo=new_channelinfo;\r
+\r
+\r
         havechannelinfo=true;\r
 \r
         return 1;\r
index 24e5b4d957a072eea415325675c933a9a9c611ee..fa5c01bd39a8932acb5cc8ce33fbbd6f6bfbaf4b 100644 (file)
@@ -40,7 +40,7 @@ class DemuxerTS : public Demuxer
     int findPTS(UCHAR* buf, int len, ULLONG* dest);\r
     void setVID(int p_vID);\r
     void setTID(int p_tID);\r
-    void setAID(int p_aID, int type);\r
+    void setAID(int p_aID, int type, int streamtype);\r
     void setSubID(int p_subID);\r
     int  getVID() { return vID; }\r
     int  getTID() { return tID; }\r
@@ -54,7 +54,7 @@ class DemuxerTS : public Demuxer
     ULONG getPacketNum();\r
     UINT stripAudio(UCHAR* buf, UINT len);\r
     static bool scanForVideo(UCHAR* buf, UINT len, bool &ish264);\r
-    Channel getChannelInfo() {return channelinfo;};\r
+    Channel *getChannelInfo() {return &channelinfo;};\r
 \r
 \r
   private:\r
index 9e2032ae9177080aa3b748aa3eab90b4bd3c22a5..bb8f32e5cc4d0ee36f5dbb93921414295a0e04c1 100644 (file)
@@ -31,6 +31,7 @@
 #define MPTYPE_MPEG_AUDIO_LAYER3 0x04 //for media mp3 playback\r
 #define MPTYPE_TELETEXT 0x05 //for EBU VBI teletext\r
 #define MPTYPE_VIDEO_H264 0x06\r
+#define MPTYPE_AAC_LATM 0x07\r
 \r
 \r
 \r
index 1650ed482d3d8b121d6df5ecb95b92266fb62349..ddff93fa76e159e7a820ead55f5b552c44ebdab7 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -225,13 +225,13 @@ int *Player::getTeletxtSubtitlePages()
     return teletext->getSubtitlePages();\r
 }\r
 \r
-void Player::setAudioChannel(int newChannel, int type)\r
+void Player::setAudioChannel(int newChannel, int type, int streamtype)\r
 {\r
     if (is_pesrecording) {\r
         demuxer->setAudioStream(newChannel);\r
         return;\r
     } else {\r
-        ((DemuxerTS*)demuxer)->setAID(newChannel,type);\r
+        ((DemuxerTS*)demuxer)->setAID(newChannel,type,streamtype);\r
         return;\r
     }\r
 }\r
@@ -265,11 +265,11 @@ void  Player::turnSubtitlesOn(bool ison) {
 \r
 }\r
 \r
-Channel Player::getDemuxerChannel() {\r
+Channel Player::getDemuxerChannel() {\r
     if (!is_pesrecording) {\r
         return ((DemuxerTS*) demuxer)->getChannelInfo();\r
     } \r
-    return Channel(); //Should not happen!\r
+    return NULL; //Should not happen!\r
 }\r
 \r
 \r
index 9658544b09367d2685954c0867688712d9a6c5fc..5c9d7f7e9e1ab3f2c7d0e74dd8220478dc58ff9f 100644 (file)
--- a/player.h
+++ b/player.h
@@ -59,7 +59,7 @@ class Player : public Thread_TYPE, public Callback
     void setStartFrame(ULONG frameNum);\r
     void setLengthBytes(ULLONG length);\r
     void setLengthFrames(ULONG length);\r
-    void setAudioChannel(int newChannel, int type);\r
+    void setAudioChannel(int newChannel, int type, int streamtype);\r
     void setSubtitleChannel(int newChannel);\r
     bool toggleSubtitles();\r
     void turnSubtitlesOn(bool ison); \r
@@ -88,7 +88,7 @@ class Player : public Thread_TYPE, public Callback
     int getCurrentAudioChannel();\r
     int getCurrentSubtitleChannel();\r
     bool isPesRecording() { return is_pesrecording; }\r
-    Channel getDemuxerChannel();\r
+    Channel *getDemuxerChannel();\r
 \r
    TeletextDecoderVBIEBU * getTeletextDecoder() { return teletext; }\r
 \r
index 601ddefa5878c99c24b653caf3468bed0f8ae7c6..3cbe69d51ef67e92df90a6e6c5eb7d84c3755b03 100644 (file)
@@ -46,7 +46,7 @@ class PlayerLive
     virtual void go(ULONG index)=0;
     virtual void setChannel(ULONG index)=0;
     virtual void stop()=0;
-    virtual void setAudioChannel(int newChannel,int type)=0;
+    virtual void setAudioChannel(int newChannel,int type,int streamtype)=0;
     virtual void setSubtitleChannel(int newChannel)=0;
 
     virtual bool* getDemuxerMpegAudioChannels()=0;
index 90af2b5918632dd3c81b299a94756782b102fa4d..0a2fe57365d454681ce5cf8f7f82fb081f187aa6 100644 (file)
@@ -111,9 +111,9 @@ int PlayerLiveRadio::getCurrentSubtitleChannel(){
     return demuxer->getSubID();\r
 }\r
 \r
-void PlayerLiveRadio::setAudioChannel(int newChannel, int type)\r
+void PlayerLiveRadio::setAudioChannel(int newChannel, int type,int streamtype)\r
 {\r
-  demuxer->setAID(newChannel, type);\r
+  demuxer->setAID(newChannel, type,streamtype);\r
 }\r
 \r
 void PlayerLiveRadio::setSubtitleChannel(int newChannel)\r
@@ -404,16 +404,45 @@ void PlayerLiveRadio::threadMethod()
           Channel* chan = (*chanList)[i.channelIndex];\r
           chan->loadPids();\r
 \r
+          bool found=false;\r
+\r
           if (chan->numAPids > 0) \r
           {\r
-            demuxer->setAID(chan->apids[0].pid,0);\r
-            logger->log("PlayerLiveRadio", Log::DEBUG, "Demuxer pids: %u %u", chan->vpid, chan->apids[0].pid);\r
+                 int j=0;\r
+                 while (j<chan->numAPids && !found) {\r
+                         if (Audio::getInstance()->streamTypeSupported(chan->apids[j].type)) {\r
+                                 demuxer->setAID(chan->apids[j].pid,0,chan->apids[j].type);\r
+                                 audio->setStreamType(Audio::MPEG2_PES);\r
+                                 logger->log("PlayerLiveRadio", Log::DEBUG, "Demuxer pids: %u %u %u", chan->vpid, chan->apids[j].pid,chan->apids[j].type);\r
+                                 found=true;\r
+                         }\r
+                         j++;\r
+                 }\r
           }\r
-          else \r
+\r
+          if (!found)\r
           {\r
-            logger->log("PlayerLiveRadio", Log::WARN, "Demuxer no pids!");\r
+                 if (chan->numDPids > 0  && audio->maysupportAc3())\r
+                 {\r
+                         int j=0;\r
+                         while (j<chan->numDPids && !found) {\r
+                                 if (Audio::getInstance()->streamTypeSupported(chan->dpids[j].type)) {\r
+                                         demuxer->setAID(chan->dpids[j].pid,1,chan->dpids[j].type);\r
+                                         audio->setStreamType(Audio::MPEG2_PES);\r
+                                         logger->log("PlayerLiveRadio", Log::DEBUG, "Demuxer pids: %u %u (ac3) %u", chan->vpid, chan->dpids[j].pid,chan->dpids[j].type);\r
+                                         found=true;\r
+                                 }\r
+                                 j++;\r
+                         }\r
+                 }\r
+                 else\r
+                 {\r
+                         logger->log("PlayerLiveRadio", Log::WARN, "Demuxer no pids!");\r
+                 }\r
           }\r
 \r
+\r
+\r
           int streamSuccess = vdr->streamChannel(chan->number, this);\r
           if (!checkError() && !streamSuccess)\r
           {      \r
index 9a3865a93b137a27ce7b5a8c8251424864629a88..4c5b783700085ca50574d4ff57fe3991860712d5 100644 (file)
@@ -60,7 +60,7 @@ class PlayerLiveRadio : public PlayerLive, public Thread_TYPE, public Callback,
     virtual void go(ULONG index);
     virtual void setChannel(ULONG index);
     virtual void stop();
-    virtual void setAudioChannel(int newChannel, int type);
+    virtual void setAudioChannel(int newChannel, int type,int streamtype);
     virtual void setSubtitleChannel(int newChannel);
 
     virtual bool* getDemuxerMpegAudioChannels();
index e9644897f1303cd1a6e6a2d4b0fc1d4ff740e0ad..7d42f72316f7e17041842f4f3188122eb0b102c8 100644 (file)
@@ -135,9 +135,9 @@ int PlayerLiveTV::getCurrentAudioChannel()
   return demuxer->getAID();\r
 }\r
 \r
-void PlayerLiveTV::setAudioChannel(int newChannel, int type)\r
+void PlayerLiveTV::setAudioChannel(int newChannel, int type,int streamtype)\r
 {\r
-  demuxer->setAID(newChannel,type);\r
+  demuxer->setAID(newChannel,type,streamtype);\r
 }\r
 \r
 void PlayerLiveTV::setSubtitleChannel(int newChannel)\r
@@ -708,18 +708,36 @@ void PlayerLiveTV::threadMethod()
            demuxer->setVID(chan->vpid);\r
            video->seth264mode(chan->vstreamtype==0x1b);\r
 \r
+           bool found=false;\r
+\r
           if (chan->numAPids > 0) \r
           {\r
-            demuxer->setAID(chan->apids[0].pid,0);\r
-            audio->setStreamType(Audio::MPEG2_PES);\r
-            logger->log("PlayerLiveTV", Log::DEBUG, "Demuxer pids: %u %u", chan->vpid, chan->apids[0].pid);\r
+                 int j=0;\r
+                 while (j<chan->numAPids && !found) {\r
+                         if (Audio::getInstance()->streamTypeSupported(chan->apids[j].type)) {\r
+                                 demuxer->setAID(chan->apids[j].pid,0,chan->apids[j].type);\r
+                                 audio->setStreamType(Audio::MPEG2_PES);\r
+                                 logger->log("PlayerLiveTV", Log::DEBUG, "Demuxer pids: %u %u %u", chan->vpid, chan->apids[j].pid,chan->apids[j].type);\r
+                                 found=true;\r
+                         }\r
+                         j++;\r
+                 }\r
           }\r
-          else \r
+\r
+          if (!found)\r
           {\r
               if (chan->numDPids > 0  && audio->maysupportAc3()) \r
               {\r
-                  demuxer->setAID(chan->dpids[0].pid,1);\r
-                  logger->log("PlayerLiveTV", Log::DEBUG, "Demuxer pids: %u %u (ac3)", chan->vpid, chan->dpids[0].pid);\r
+                 int j=0;\r
+                 while (j<chan->numDPids && !found) {\r
+                         if (Audio::getInstance()->streamTypeSupported(chan->dpids[j].type)) {\r
+                                 demuxer->setAID(chan->dpids[j].pid,1,chan->dpids[j].type);\r
+                                 audio->setStreamType(Audio::MPEG2_PES);\r
+                                 logger->log("PlayerLiveTV", Log::DEBUG, "Demuxer pids: %u %u (ac3) %u", chan->vpid, chan->dpids[j].pid,chan->dpids[j].type);\r
+                                 found=true;\r
+                         }\r
+                         j++;\r
+                 }\r
               } \r
               else\r
               {\r
index 1ed46d07a63f40e892200316a163666470d69282..4fba1c8984c0c1e430b4f25045d55a1d4bb79486 100644 (file)
@@ -67,7 +67,7 @@ class PlayerLiveTV : public PlayerLive, public Thread_TYPE, public Callback, pub
     virtual void go(ULONG index);
     virtual void setChannel(ULONG index);
     virtual void stop();
-    virtual void setAudioChannel(int newChannel,int type);
+    virtual void setAudioChannel(int newChannel,int type,int streamtype);
     virtual void setSubtitleChannel(int newChannel);
     virtual bool toggleSubtitles();
     virtual void turnSubtitlesOn(bool ison); 
index c6103c7a58d5ecbfd9dcafa16d8c761e2e581e9d..4ed9c8772d935dacc91434ef88e0c273d52348d7 100644 (file)
@@ -305,8 +305,8 @@ VAudioSelector::VAudioSelector(void* tparent, Channel* channel, int currentAudio
   {
       AudioSubtitleChannel* sc = new AudioSubtitleChannel();
       sc->type = 0x10;
-      sc->name = new char[strlen(channel->spids[i].name) + 1];
-      strcpy(sc->name, channel->spids[i].name);
+      sc->name = new char[strlen(channel->spids[i].desc) + 1];
+      strcpy(sc->name, channel->spids[i].desc);
       sc->pestype = channel->spids[i].pid;
       scl.push_back(sc);  
   }
@@ -361,10 +361,11 @@ VAudioSelector::VAudioSelector(void* tparent, Channel* channel, int currentAudio
   {
     AudioSubtitleChannel* ac = new AudioSubtitleChannel();
     ac->type = 0;
-    ac->name = new char[strlen(channel->apids[i].name) + 1];
-    strcpy(ac->name, channel->apids[i].name);
+    ac->name = new char[strlen(channel->apids[i].desc) + 1];
+    strcpy(ac->name, channel->apids[i].desc);
     ac->pestype = channel->apids[i].pid;
-    acl.push_back(ac);
+    ac->streamtype=channel->apids[i].type;
+    if (Audio::getInstance()->streamTypeSupported(ac->streamtype))acl.push_back(ac);
   }
   
   if (Audio::getInstance()->supportsAc3())
@@ -373,10 +374,11 @@ VAudioSelector::VAudioSelector(void* tparent, Channel* channel, int currentAudio
     {
       AudioSubtitleChannel* ac = new AudioSubtitleChannel();
       ac->type = 1;
-      ac->name = new char[strlen(channel->dpids[i].name) + 1];
-      strcpy(ac->name, channel->dpids[i].name);
+      ac->name = new char[strlen(channel->dpids[i].desc) + 1];
+      strcpy(ac->name, channel->dpids[i].desc);
       ac->pestype = channel->dpids[i].pid;
-      acl.push_back(ac);
+      ac->streamtype=channel->dpids[i].type;
+      if (Audio::getInstance()->streamTypeSupported(ac->streamtype))acl.push_back(ac);
     }
   }
     
@@ -510,7 +512,8 @@ int VAudioSelector::handleCommand(int command)
             m->from = this;
             m->to = parent;
             m->message = Message::SUBTITLE_CHANGE_CHANNEL;
-            m->parameter = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
+            m->parameter = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16
+                       |(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
             Command::getInstance()->postMessageNoLock(m);
         } else {
             asl.down();
@@ -520,7 +523,8 @@ int VAudioSelector::handleCommand(int command)
             m->from = this;
             m->to = parent;
             m->message = Message::AUDIO_CHANGE_CHANNEL;
-            m->parameter = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
+            m->parameter = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16
+                       |(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
             Command::getInstance()->postMessageNoLock(m);
         }
 
index bf2f36dc2471a57e4e31164edb7c9b62782fe425..63efe33897b16a721c02aff2c41ddd55ac6ad289 100644 (file)
@@ -45,6 +45,7 @@ class AudioSubtitleChannel
     int type;
     char* name;
     int pestype;
+    int streamtype;
 };
 
 
index 7c5e427885fbf807bc7a083ab8b23271b755c8c4..7c0b66e83a7f235822cf5a2560e4eae9e8b24419 100644 (file)
@@ -161,12 +161,19 @@ void VConnect::threadMethod()
     if (success)
     {
       logger->log("VConnect", Log::DEBUG, "Connected ok, doing login");
-      success = vdr->doLogin();
+      unsigned int version_server,version_client;
+      success = vdr->doLogin(&version_server,&version_client);
 
       if (!success)
       {
         vdr->disconnect();
-        setOneLiner(tr("Login failed"));
+        if (version_server!=version_client) {
+               char buffer[1024];
+               sprintf(buffer,"Protocoll mismatch s: %x c: %x",version_server,version_client);
+               setOneLiner(buffer);
+        } else {
+               setOneLiner(tr("Login failed"));
+        }
         delay = 3000;
       }
     }
diff --git a/vdr.cc b/vdr.cc
index 19128ab96710340fab1b79a3ca507a2e7a414344..1798c3b1ed7ae23ff1f1e69ecc949a6f91e58599 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -38,6 +38,8 @@
 #include "video.h"\r
 #include "osd.h"\r
 \r
+#define VOMP_PROTOCOLL_VERSION 0x00000100\r
+\r
 VDR* VDR::instance = NULL;\r
 //prepare a request\r
 //will create a request package from a command variable and fill this\r
@@ -593,7 +595,7 @@ bool VDR_PacketReceiver::call(void* userTag)
 \r
 /////////////////////////////////////////////////////////////////////////////\r
 \r
-int VDR::doLogin()\r
+int VDR::doLogin(unsigned int* v_server,unsigned int* v_client)\r
 {\r
   VDR_RequestPacket vrp;\r
   if (!vrp.init(VDR_LOGIN, true, 6)) return 0;\r
@@ -610,8 +612,19 @@ int VDR::doLogin()
   long vdrTimeOffset = vresp->extractLONG();\r
   logger->log("VDR", Log::DEBUG, "offset = %i", vdrTimeOffset);\r
 \r
+  unsigned int version=vresp->extractULONG();\r
+\r
+  *v_server=version;\r
+  *v_client=VOMP_PROTOCOLL_VERSION;\r
+\r
   delete vresp;\r
 \r
+  if (version!=VOMP_PROTOCOLL_VERSION) {\r
+\r
+         return 0;\r
+\r
+  }\r
+\r
   // Set the time and zone on the MVP only\r
 \r
 #if !defined(WIN32) && !defined(__ANDROID__)\r
@@ -1242,7 +1255,9 @@ void VDR::getChannelPids(Channel* channel)
   {\r
     apid newapid;\r
     newapid.pid = vresp->extractULONG();\r
-    newapid.name = vresp->extractString();\r
+    char * name=vresp->extractString();\r
+    strncpy(newapid.desc,name,9);\r
+    delete [] name;\r
     channel->apids.push_back(newapid);\r
   }\r
 \r
@@ -1252,7 +1267,9 @@ void VDR::getChannelPids(Channel* channel)
   {\r
     apid newdpid;\r
     newdpid.pid = vresp->extractULONG();\r
-    newdpid.name = vresp->extractString();\r
+    char * name=vresp->extractString();\r
+    strncpy(newdpid.desc,name,9);\r
+    delete [] name;\r
     channel->dpids.push_back(newdpid);\r
   }\r
 \r
@@ -1262,10 +1279,27 @@ void VDR::getChannelPids(Channel* channel)
   {\r
     apid newspid;\r
     newspid.pid = vresp->extractULONG();\r
-    newspid.name = vresp->extractString();\r
+    char * name=vresp->extractString();\r
+    strncpy(newspid.desc,name,9);\r
+    delete [] name;\r
     channel->spids.push_back(newspid);\r
   }\r
   channel->tpid = vresp->extractULONG();\r
+  // extension\r
+  for (ULONG i = 0; i < channel->numAPids; i++)\r
+  {\r
+         channel->apids[i].type = vresp->extractULONG();\r
+  }\r
+  for (ULONG i = 0; i < channel->numDPids; i++)\r
+  {\r
+         channel->dpids[i].type = vresp->extractULONG();\r
+  }\r
+  for (ULONG i = 0; i < channel->numSPids; i++)\r
+  {\r
+         channel->spids[i].type = vresp->extractULONG();\r
+         channel->spids[i].data1 = vresp->extractULONG();\r
+         channel->spids[i].data2 = vresp->extractULONG();\r
+  }\r
 \r
   delete vresp;\r
   \r
diff --git a/vdr.h b/vdr.h
index 01f6b0fe297834a0bfd9f812264b42b4cee594ea..5a5172d70e844a7eb154f41720b35f58452e6e2a 100644 (file)
--- a/vdr.h
+++ b/vdr.h
@@ -152,7 +152,7 @@ class VDR : public Thread_TYPE, public EventDispatcher, public MediaProvider, pu
     //  configSave\r
     //  setEventTimer\r
 \r
-    int           doLogin();\r
+    int           doLogin(unsigned int* v_server,unsigned int* v_client);\r
     bool          getRecordingsList(RecMan* recman);\r
     RecInfo*      getRecInfo(char* fileName);\r
     int           deleteRecording(char* fileName);\r
index b1998432a87380737a23b3d6457636ec85b8d058..69e8a49464a0cbf9d390ad48295f0fcb48a4ef69 100644 (file)
@@ -997,7 +997,7 @@ void VVideoLiveTV::processMessage(Message* m)
   else if (m->message == Message::AUDIO_CHANGE_CHANNEL)\r
   {\r
     Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change audio channel to %i", m->parameter);\r
-    player->setAudioChannel((m->parameter & 0xFFFF),(m->parameter & 0xFF0000)>>16);\r
+    player->setAudioChannel((m->parameter & 0xFFFF),(m->parameter & 0xFF0000)>>16,(m->parameter & 0xFF000000)>>24);\r
   } \r
   else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)\r
   {\r
index 65b45f9d4488c1c8e29ab25570fa6ae9b8f95ea0..56142bb8ae31ee3b1d0d89b8eb33ac555fbe5863 100644 (file)
@@ -568,7 +568,7 @@ void VVideoRec::processMessage(Message* m)
   else if (m->message == Message::AUDIO_CHANGE_CHANNEL)\r
   {\r
     Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change audio channel to %i", m->parameter);\r
-    player->setAudioChannel(m->parameter&0xFFFF,(m->parameter&0xFF0000)>> 16 );\r
+    player->setAudioChannel(m->parameter&0xFFFF,(m->parameter&0xFF0000)>> 16,(m->parameter&0xFF000000)>> 24 );\r
   }\r
   else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)\r
   {\r
@@ -681,18 +681,18 @@ void VVideoRec::doAudioSelector()
             subtitleChannel, subtitleType, myRec->recInfo);\r
     } else {\r
         // Draw the selector\r
-        Channel temp_channel=player->getDemuxerChannel();\r
-        RecInfo *cur_info= myRec->recInfo;\r
-        unsigned char numchan_recinfo = cur_info->numComponents;\r
+        Channel *temp_channel=player->getDemuxerChannel();\r
+       // RecInfo *cur_info= myRec->recInfo;\r
+     /*   unsigned char numchan_recinfo = cur_info->numComponents;\r
         unsigned char numchan_subtitles_siz = temp_channel.numSPids;\r
         ULONG mp_audcounter = 0;\r
         ULONG ac3_counter = 0;\r
-        int dvb_subcounter = 1;\r
+        int dvb_subcounter = 1;*/\r
+        int i;\r
         \r
-        unsigned char type;\r
+        /*unsigned char type;\r
         char* lang;\r
         char* description;\r
-        int i;\r
         for (i = 0; i < numchan_recinfo; i++)\r
         {   \r
             apid* ac = NULL;\r
@@ -732,32 +732,29 @@ void VVideoRec::doAudioSelector()
                     \r
                 }\r
             }\r
-        }\r
-        for (i=0;i<temp_channel.numAPids;i++) {\r
-            apid *ac=&temp_channel.apids[i];\r
-            if (ac->name==NULL) {\r
-                ac->name = new char[strlen(tr("unknown")) + 1];\r
-                strcpy(ac->name, tr("unknown"));\r
+        }*/\r
+        for (i=0;i<temp_channel->numAPids;i++) {\r
+            apid *ac=&temp_channel->apids[i];\r
+            if (ac->desc[0]==0) {\r
+                strncpy(ac->desc, tr("unknown"),9);\r
             }\r
         }\r
-        for (i=0;i<temp_channel.numDPids;i++) {\r
-            apid *ac=&temp_channel.dpids[i];\r
-            if (ac->name==NULL) {\r
-                ac->name = new char[strlen(tr("unknown")) + 1];\r
-                strcpy(ac->name, tr("unknown"));\r
+        for (i=0;i<temp_channel->numDPids;i++) {\r
+            apid *ac=&temp_channel->dpids[i];\r
+            if (ac->desc[0]==0) {\r
+                strncpy(ac->desc, tr("unknown"),9);\r
             }\r
         }\r
-        for (i=0;i<temp_channel.numSPids;i++) {\r
-            apid *ac=&temp_channel.spids[i];\r
-            if (ac->name==NULL) {\r
-                ac->name = new char[strlen(tr("unknown")) + 1];\r
-                strcpy(ac->name, tr("unknown"));\r
+        for (i=0;i<temp_channel->numSPids;i++) {\r
+            apid *ac=&temp_channel->spids[i];\r
+            if (ac->desc[0]==0) {\r
+                strncpy(ac->desc, tr("unknown"),9);\r
             }\r
         }\r
 \r
-        vas = new VAudioSelector(this,&temp_channel , (player)->getCurrentAudioChannel(),\r
+        vas = new VAudioSelector(this,temp_channel , (player)->getCurrentAudioChannel(),\r
             subtitleType,subtitleChannel,player->getTeletxtSubtitlePages());  \r
-         for (i=0;i<temp_channel.numAPids;i++) {\r
+      /*   for (i=0;i<temp_channel.numAPids;i++) {\r
             apid *ac=&temp_channel.apids[i];\r
             delete[] ac->name;\r
             ac->name=NULL;\r
@@ -771,7 +768,7 @@ void VVideoRec::doAudioSelector()
             apid *ac=&temp_channel.spids[i];\r
             delete[] ac->name;\r
             ac->name=NULL;\r
-        }\r
+        }*/\r
     }\r
 \r
 \r