vdr and aac support

Message ID 4BEFE4E8.1030602@tvdr.de
State New
Headers

Commit Message

Klaus Schmidinger May 16, 2010, 12:28 p.m. UTC
  On 16.05.2010 12:55, Klaus Schmidinger wrote:
> On 15.05.2010 20:00, Newsy Paper wrote:
>> hi Luis,
>>
>> seems like an ugly hack. Channel I'm receiving here has:
>> Stream_type: 15 (0x0f)  [= ISO/IEC 13818-7 Audio with ADTS transport sytax]
> 
> If you do this instead:
> 
> --- pat.c       2010/03/27 15:17:46     2.9
> +++ pat.c       2010/05/16 10:53:46
> @@ -358,6 +358,8 @@
>                        break;
>                case 3: // STREAMTYPE_11172_AUDIO
>                case 4: // STREAMTYPE_13818_AUDIO
> +              case 0x0F: // ISO/IEC 13818-7 Audio with ADTS transport sytax
> +              case 0x11: // ISO/IEC 14496-3 Audio with LATM transport syntax
>                        {
>                        if (NumApids < MAXAPIDS) {
>                           Apids[NumApids] = esPid;
> 
> 
> does this put the proper PID into the APID section?
> This may still not work with recordings, but I first want to know
> whether a proper PID is detected that way.

Ok, here's a complete patch that attempts to handle audio types.
It is untested, so please use it with care.
Please let me know whether this works with your audio types in
live mode and with replaying recordings.

Klaus
  

Comments

Newsy Paper May 16, 2010, 9:52 p.m. UTC | #1
Hi Klaus,

just tested your aac patch. I would say your patch is working fine. AAC pid is found + added automatically, femon plugin shows HE-AAC as codec. If I connect to xineliboutput with vlc I get correct audio, but with xine there's no audio, perhaps there are some more modifications necessary in xine but your part is complete. Thank you very much for that.

kind regards


Newspaperman

--- Klaus Schmidinger <Klaus.Schmidinger@tvdr.de> schrieb am So, 16.5.2010:

> Von: Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
> Betreff: Re: [vdr] vdr and aac support
> An: vdr@linuxtv.org
> Datum: Sonntag, 16. Mai, 2010 14:28 Uhr
> On 16.05.2010 12:55, Klaus
> Schmidinger wrote:
> > On 15.05.2010 20:00, Newsy Paper wrote:
> >> hi Luis,
> >>
> >> seems like an ugly hack. Channel I'm receiving
> here has:
> >> Stream_type: 15 (0x0f)  [= ISO/IEC 13818-7
> Audio with ADTS transport sytax]
> > 
> > If you do this instead:
> > 
> > --- pat.c       2010/03/27
> 15:17:46     2.9
> > +++ pat.c       2010/05/16
> 10:53:46
> > @@ -358,6 +358,8 @@
> >               
>         break;
> >               
> case 3: // STREAMTYPE_11172_AUDIO
> >               
> case 4: // STREAMTYPE_13818_AUDIO
> > +              case
> 0x0F: // ISO/IEC 13818-7 Audio with ADTS transport sytax
> > +              case
> 0x11: // ISO/IEC 14496-3 Audio with LATM transport syntax
> >               
>         {
> >               
>         if (NumApids < MAXAPIDS) {
> >               
>        
>    Apids[NumApids] = esPid;
> > 
> > 
> > does this put the proper PID into the APID section?
> > This may still not work with recordings, but I first
> want to know
> > whether a proper PID is detected that way.
> 
> Ok, here's a complete patch that attempts to handle audio
> types.
> It is untested, so please use it with care.
> Please let me know whether this works with your audio types
> in
> live mode and with replaying recordings.
> 
> Klaus
> 
> -----Integrierter Anhang folgt-----
> 
> 
> -----Integrierter Anhang folgt-----
> 
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>
  
Newsy Paper May 17, 2010, 6:45 a.m. UTC | #2
funny, today sound works with xine, yesterday it didn't although I had sound on all other channels with mpeg2 audio. Even recorings work fine, so aac support is perfect here :)


kind regards

Newspaperman

--- Newsy Paper <newspaperman_germany@yahoo.com> schrieb am So, 16.5.2010:

> Von: Newsy Paper <newspaperman_germany@yahoo.com>
> Betreff: Re: [vdr] vdr and aac support
> An: "VDR Mailing List" <vdr@linuxtv.org>
> Datum: Sonntag, 16. Mai, 2010 23:52 Uhr
> Hi Klaus,
> 
> just tested your aac patch. I would say your patch is
> working fine. AAC pid is found + added automatically, femon
> plugin shows HE-AAC as codec. If I connect to xineliboutput
> with vlc I get correct audio, but with xine there's no
> audio, perhaps there are some more modifications necessary
> in xine but your part is complete. Thank you very much for
> that.
> 
> kind regards
> 
> 
> Newspaperman
> 
> --- Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
> schrieb am So, 16.5.2010:
> 
> > Von: Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
> > Betreff: Re: [vdr] vdr and aac support
> > An: vdr@linuxtv.org
> > Datum: Sonntag, 16. Mai, 2010 14:28 Uhr
> > On 16.05.2010 12:55, Klaus
> > Schmidinger wrote:
> > > On 15.05.2010 20:00, Newsy Paper wrote:
> > >> hi Luis,
> > >>
> > >> seems like an ugly hack. Channel I'm
> receiving
> > here has:
> > >> Stream_type: 15 (0x0f)  [= ISO/IEC 13818-7
> > Audio with ADTS transport sytax]
> > > 
> > > If you do this instead:
> > > 
> > > --- pat.c       2010/03/27
> > 15:17:46     2.9
> > > +++ pat.c       2010/05/16
> > 10:53:46
> > > @@ -358,6 +358,8 @@
> > >               
> >         break;
> > >               
> > case 3: // STREAMTYPE_11172_AUDIO
> > >               
> > case 4: // STREAMTYPE_13818_AUDIO
> > > +              case
> > 0x0F: // ISO/IEC 13818-7 Audio with ADTS transport
> sytax
> > > +              case
> > 0x11: // ISO/IEC 14496-3 Audio with LATM transport
> syntax
> > >               
> >         {
> > >               
> >         if (NumApids < MAXAPIDS) {
> > >               
> >        
> >    Apids[NumApids] = esPid;
> > > 
> > > 
> > > does this put the proper PID into the APID
> section?
> > > This may still not work with recordings, but I
> first
> > want to know
> > > whether a proper PID is detected that way.
> > 
> > Ok, here's a complete patch that attempts to handle
> audio
> > types.
> > It is untested, so please use it with care.
> > Please let me know whether this works with your audio
> types
> > in
> > live mode and with replaying recordings.
> > 
> > Klaus
> > 
> > -----Integrierter Anhang folgt-----
> > 
> > 
> > -----Integrierter Anhang folgt-----
> > 
> > _______________________________________________
> > vdr mailing list
> > vdr@linuxtv.org
> > http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
> > 
> 
> 
> 
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>
  
Luis Fernandes May 17, 2010, 7:49 p.m. UTC | #3
Only to report, the patch works well in both live TV and recordings
with xineliboutput.
This patch is expected to:
    * DVB-T in Norway
    * DVB-T in New Zealand
    * DVB-T and DVBS2 in Portugal

Thank you very much Klaus

2010/5/17 Newsy Paper <newspaperman_germany@yahoo.com>:
> funny, today sound works with xine, yesterday it didn't although I had sound on all other channels with mpeg2 audio. Even recorings work fine, so aac support is perfect here :)
>
>
> kind regards
>
> Newspaperman
>
> --- Newsy Paper <newspaperman_germany@yahoo.com> schrieb am So, 16.5.2010:
>
>> Von: Newsy Paper <newspaperman_germany@yahoo.com>
>> Betreff: Re: [vdr] vdr and aac support
>> An: "VDR Mailing List" <vdr@linuxtv.org>
>> Datum: Sonntag, 16. Mai, 2010 23:52 Uhr
>> Hi Klaus,
>>
>> just tested your aac patch. I would say your patch is
>> working fine. AAC pid is found + added automatically, femon
>> plugin shows HE-AAC as codec. If I connect to xineliboutput
>> with vlc I get correct audio, but with xine there's no
>> audio, perhaps there are some more modifications necessary
>> in xine but your part is complete. Thank you very much for
>> that.
>>
>> kind regards
>>
>>
>> Newspaperman
>>
>> --- Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
>> schrieb am So, 16.5.2010:
>>
>> > Von: Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
>> > Betreff: Re: [vdr] vdr and aac support
>> > An: vdr@linuxtv.org
>> > Datum: Sonntag, 16. Mai, 2010 14:28 Uhr
>> > On 16.05.2010 12:55, Klaus
>> > Schmidinger wrote:
>> > > On 15.05.2010 20:00, Newsy Paper wrote:
>> > >> hi Luis,
>> > >>
>> > >> seems like an ugly hack. Channel I'm
>> receiving
>> > here has:
>> > >> Stream_type: 15 (0x0f)  [= ISO/IEC 13818-7
>> > Audio with ADTS transport sytax]
>> > >
>> > > If you do this instead:
>> > >
>> > > --- pat.c       2010/03/27
>> > 15:17:46     2.9
>> > > +++ pat.c       2010/05/16
>> > 10:53:46
>> > > @@ -358,6 +358,8 @@
>> > >
>> >         break;
>> > >
>> > case 3: // STREAMTYPE_11172_AUDIO
>> > >
>> > case 4: // STREAMTYPE_13818_AUDIO
>> > > +              case
>> > 0x0F: // ISO/IEC 13818-7 Audio with ADTS transport
>> sytax
>> > > +              case
>> > 0x11: // ISO/IEC 14496-3 Audio with LATM transport
>> syntax
>> > >
>> >         {
>> > >
>> >         if (NumApids < MAXAPIDS) {
>> > >
>> >
>> >    Apids[NumApids] = esPid;
>> > >
>> > >
>> > > does this put the proper PID into the APID
>> section?
>> > > This may still not work with recordings, but I
>> first
>> > want to know
>> > > whether a proper PID is detected that way.
>> >
>> > Ok, here's a complete patch that attempts to handle
>> audio
>> > types.
>> > It is untested, so please use it with care.
>> > Please let me know whether this works with your audio
>> types
>> > in
>> > live mode and with replaying recordings.
>> >
>> > Klaus
>> >
>> > -----Integrierter Anhang folgt-----
>> >
>> >
>> > -----Integrierter Anhang folgt-----
>> >
>> > _______________________________________________
>> > vdr mailing list
>> > vdr@linuxtv.org
>> > http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>> >
>>
>>
>>
>> _______________________________________________
>> vdr mailing list
>> vdr@linuxtv.org
>> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>>
>
>
>
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>
  
Luca Olivetti May 18, 2010, 7:20 p.m. UTC | #4
Al 16/05/10 14:28, En/na Klaus Schmidinger ha escrit:

>
> Ok, here's a complete patch that attempts to handle audio types.
> It is untested, so please use it with care.
> Please let me know whether this works with your audio types in
> live mode and with replaying recordings.

As of yesterday I can tune to a dvb-t hd channel where vdr doesn't pick 
the audio pid, my tv picks it and identifies it as "dolby digital plus".
I tried this patch but vdr still doesn't pick the audio pid.
If I disable channel updating and manually introduce the pid, I cannot 
decode the audio with xine.
vlc (through streamdev) doesn't decode it either but it tells me that 
it's of type eac3.

This is the output of dvbsnoop:

$ dvbsnoop -adapter 1 0
dvbsnoop V1.4.00 -- http://dvbsnoop.sourceforge.net/

------------------------------------------------------------
SECT-Packet: 00000001   PID: 0 (0x0000), Length: 36 (0x0024)
Time received: Tue 2010-05-18  21:17:20.758
------------------------------------------------------------
   0000:  00 b0 21 9c 40 cd 00 00  00 00 e0 10 9c 41 e3 e8 
..!.@........A..
   0010:  9c 42 e7 d0 9c 43 eb b8  9c 45 e7 e4 9c 46 eb cc 
.B...C...E...F..
   0020:  9e 44 56 b1                                        .DV. 


PID:  0 (0x0000)  [= assigned for: ISO 13818-1 Program Association Table 
(PAT)]
Guess table from table id... 

PAT-decoding.... 

Table_ID: 0 (0x00)  [= Program Association Table (PAT)] 

section_syntax_indicator: 1 (0x01) 

(fixed): 0 (0x00) 

reserved_1: 3 (0x03) 

Section_length: 33 (0x0021) 

Transport_Stream_ID: 40000 (0x9c40) 

reserved_2: 3 (0x03) 

Version_number: 6 (0x06) 

current_next_indicator: 1 (0x01)  [= valid now] 

Section_number: 0 (0x00) 

Last_Section_number: 0 (0x00) 


     Program_number: 0 (0x0000)
     reserved: 7 (0x07)
     Network_PID: 16 (0x0010)

     Program_number: 40001 (0x9c41)
     reserved: 7 (0x07)
     Program_map_PID: 1000 (0x03e8)

     Program_number: 40002 (0x9c42)
     reserved: 7 (0x07)
     Program_map_PID: 2000 (0x07d0)

     Program_number: 40003 (0x9c43)
     reserved: 7 (0x07)
     Program_map_PID: 3000 (0x0bb8)

     Program_number: 40005 (0x9c45)
     reserved: 7 (0x07)
     Program_map_PID: 2020 (0x07e4)

     Program_number: 40006 (0x9c46)
     reserved: 7 (0x07)
     Program_map_PID: 3020 (0x0bcc)

CRC: 2655278769 (0x9e4456b1)
==========================================================

The channel is the one with pmt pid 1000

$ dvbsnoop -adapter 1 1000
dvbsnoop V1.4.00 -- http://dvbsnoop.sourceforge.net/

------------------------------------------------------------
SECT-Packet: 00000001   PID: 1000 (0x03e8), Length: 46 (0x002e)
Time received: Tue 2010-05-18  21:18:11.126
------------------------------------------------------------
   0000:  02 b0 2b 9c 41 d7 00 00  e3 e9 f0 00 1b e3 e9 f0 
..+.A...........
   0010:  0a 28 04 64 00 28 3f 2a  02 fe ef 06 e4 4c f0 0a 
.(.d.(?*.....L..
   0020:  7a 02 80 c2 0a 04 73 70  61 00 e4 8e 54 ed 
z.....spa...T.

PID:  1000 (0x03e8)
Guess table from table id...
PMT-decoding....
Table_ID: 2 (0x02)  [= Program Map Table (PMT)]
section_syntax_indicator: 1 (0x01)
(fixed '0'): 0 (0x00)
reserved_1: 3 (0x03)
Section_length: 43 (0x002b)
Program_number: 40001 (0x9c41)
reserved_2: 3 (0x03)
Version_number: 11 (0x0b)
current_next_indicator: 1 (0x01)  [= valid now]
Section_number: 0 (0x00)
Last_Section_number: 0 (0x00)
reserved_3: 7 (0x07)
PCR PID: 1001 (0x03e9)
reserved_4: 15 (0x0f)
Program_info_length: 0 (0x0000)

Stream_type loop:

     Stream_type: 27 (0x1b)  [= AVC video stream as defined in ITU-T 
Rec. H.264 | ISO/IEC 14496-10 Video]
     reserved_1: 7 (0x07) 

     Elementary_PID: 1001 (0x03e9) 

     reserved_2: 15 (0x0f) 

     ES_info_length: 10 (0x000a) 


             MPEG-DescriptorTag: 40 (0x28)  [= AVC_video_descriptor]
             Descriptor_length: 4 (0x04)
                  0000:  64 00 28 3f 
     d.(?

             MPEG-DescriptorTag: 42 (0x2a)  [= 
AVC_timing_and_HRD_descriptor]
             Descriptor_length: 2 (0x02) 

                  0000:  fe ef 
     ..


     Stream_type: 6 (0x06)  [= ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES 
packets containing private data]
     reserved_1: 7 (0x07) 

     Elementary_PID: 1100 (0x044c) 

     reserved_2: 15 (0x0f) 

     ES_info_length: 10 (0x000a) 


             DVB-DescriptorTag: 122 (0x7a)  [= reserved_descriptor]
             Descriptor_length: 2 (0x02)
               ----> ERROR: unimplemented descriptor (dvb context), Report!
             Descriptor-data:
                  0000:  80 c2 
     ..

             MPEG-DescriptorTag: 10 (0x0a)  [= ISO_639_language_descriptor]
             Descriptor_length: 4 (0x04)
                ISO639_language_code:  spa
                Audio_type: 0 (0x00)  [= undefined]


CRC: 3834533101 (0xe48e54ed)
==========================================================


Bye
  

Patch

--- ./channels.c	2010/05/02 15:07:38	2.14
+++ ./channels.c	2010/05/16 11:44:31
@@ -271,14 +271,21 @@ 
   return result;
 }
 
-static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[][MAXLANGCODE2] = NULL)
+static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[][MAXLANGCODE2] = NULL, const int *t = NULL)
 {
   char *q = s;
   int i = 0;
   while (a[i] || i == 0) {
         q += sprintf(q, Base == 16 ? "%s%X" : "%s%d", i ? "," : "", a[i]);
-        if (a[i] && n && *n[i])
-           q += sprintf(q, "=%s", n[i]);
+        const char *Delim = "=";
+        if (a[i]) {
+           if (n && *n[i]) {
+              q += sprintf(q, "%s%s", Delim, n[i]);
+              Delim = "";
+              }
+           if (t && t[i])
+              q += sprintf(q, "%s@%d", Delim, t[i]);
+           }
         if (!a[i])
            break;
         i++;
@@ -287,29 +294,29 @@ 
   return q - s;
 }
 
-void cChannel::SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid)
+void cChannel::SetPids(int Vpid, int Ppid, int Vtype, int *Apids, int *Atypes, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid)
 {
   int mod = CHANNELMOD_NONE;
   if (vpid != Vpid || ppid != Ppid || vtype != Vtype || tpid != Tpid)
      mod |= CHANNELMOD_PIDS;
-  int m = IntArraysDiffer(apids, Apids, alangs, ALangs) | IntArraysDiffer(dpids, Dpids, dlangs, DLangs) | IntArraysDiffer(spids, Spids, slangs, SLangs);
+  int m = IntArraysDiffer(apids, Apids, alangs, ALangs) | IntArraysDiffer(atypes, Atypes) | IntArraysDiffer(dpids, Dpids, dlangs, DLangs) | IntArraysDiffer(spids, Spids, slangs, SLangs);
   if (m & STRDIFF)
      mod |= CHANNELMOD_LANGS;
   if (m & VALDIFF)
      mod |= CHANNELMOD_PIDS;
   if (mod) {
-     const int BufferSize = (MAXAPIDS + MAXDPIDS) * (5 + 1 + MAXLANGCODE2) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod', +10: paranoia
+     const int BufferSize = (MAXAPIDS + MAXDPIDS) * (5 + 1 + MAXLANGCODE2 + 5) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod@type', +10: paranoia
      char OldApidsBuf[BufferSize];
      char NewApidsBuf[BufferSize];
      char *q = OldApidsBuf;
-     q += IntArrayToString(q, apids, 10, alangs);
+     q += IntArrayToString(q, apids, 10, alangs, atypes);
      if (dpids[0]) {
         *q++ = ';';
         q += IntArrayToString(q, dpids, 10, dlangs);
         }
      *q = 0;
      q = NewApidsBuf;
-     q += IntArrayToString(q, Apids, 10, ALangs);
+     q += IntArrayToString(q, Apids, 10, ALangs, Atypes);
      if (Dpids[0]) {
         *q++ = ';';
         q += IntArrayToString(q, Dpids, 10, DLangs);
@@ -331,6 +338,7 @@ 
      vtype = Vtype;
      for (int i = 0; i < MAXAPIDS; i++) {
          apids[i] = Apids[i];
+         atypes[i] = Atypes[i];
          strn0cpy(alangs[i], ALangs[i], MAXLANGCODE2);
          }
      apids[MAXAPIDS] = 0;
@@ -485,10 +493,10 @@ 
      if (Channel->vpid && Channel->vtype)
         q += snprintf(q, sizeof(vpidbuf) - (q - vpidbuf), "=%d", Channel->vtype);
      *q = 0;
-     const int BufferSize = (MAXAPIDS + MAXDPIDS) * (5 + 1 + MAXLANGCODE2) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod', +10: paranoia
+     const int BufferSize = (MAXAPIDS + MAXDPIDS) * (5 + 1 + MAXLANGCODE2 + 5) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod@type', +10: paranoia
      char apidbuf[BufferSize];
      q = apidbuf;
-     q += IntArrayToString(q, Channel->apids, 10, Channel->alangs);
+     q += IntArrayToString(q, Channel->apids, 10, Channel->alangs, Channel->atypes);
      if (Channel->dpids[0]) {
         *q++ = ';';
         q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs);
@@ -547,6 +555,7 @@ 
         vpid = ppid = 0;
         vtype = 0;
         apids[0] = 0;
+        atypes[0] = 0;
         dpids[0] = 0;
         ok = false;
         if (parambuf && sourcebuf && vpidbuf && apidbuf) {
@@ -580,9 +589,15 @@ 
            char *strtok_next;
            while ((q = strtok_r(p, ",", &strtok_next)) != NULL) {
                  if (NumApids < MAXAPIDS) {
+                    atypes[NumApids] = 4; // backwards compatibility
                     char *l = strchr(q, '=');
                     if (l) {
                        *l++ = 0;
+                       char *t = strchr(l, '@');
+                       if (t) {
+                          *t++ = 0;
+                          atypes[NumApids] = strtol(t, NULL, 10);
+                          }
                        strn0cpy(alangs[NumApids], l, MAXLANGCODE2);
                        }
                     else
@@ -594,6 +609,7 @@ 
                  p = NULL;
                  }
            apids[NumApids] = 0;
+           atypes[NumApids] = 0;
            if (dpidbuf) {
               char *p = dpidbuf;
               char *q;
--- ./channels.h	2010/03/07 13:47:13	2.10
+++ ./channels.h	2010/05/16 11:06:52
@@ -104,6 +104,7 @@ 
   int ppid;
   int vtype;
   int apids[MAXAPIDS + 1]; // list is zero-terminated
+  int atypes[MAXAPIDS + 1]; // list is zero-terminated
   char alangs[MAXAPIDS][MAXLANGCODE2];
   int dpids[MAXDPIDS + 1]; // list is zero-terminated
   char dlangs[MAXDPIDS][MAXLANGCODE2];
@@ -156,6 +157,7 @@ 
   const char *Alang(int i) const { return (0 <= i && i < MAXAPIDS) ? alangs[i] : ""; }
   const char *Dlang(int i) const { return (0 <= i && i < MAXDPIDS) ? dlangs[i] : ""; }
   const char *Slang(int i) const { return (0 <= i && i < MAXSPIDS) ? slangs[i] : ""; }
+  int Atype(int i) const { return (0 <= i && i < MAXAPIDS) ? atypes[i] : 0; }
   uchar SubtitlingType(int i) const { return (0 <= i && i < MAXSPIDS) ? subtitlingTypes[i] : uchar(0); }
   uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); }
   uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); }
@@ -185,7 +187,7 @@ 
   void SetId(int Nid, int Tid, int Sid, int Rid = 0);
   void SetName(const char *Name, const char *ShortName, const char *Provider);
   void SetPortalName(const char *PortalName);
-  void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid);
+  void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, int *Atypes, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid);
   void SetCaIds(const int *CaIds); // list must be zero-terminated
   void SetCaDescriptors(int Level);
   void SetLinkChannels(cLinkChannels *LinkChannels);
--- ./pat.c	2010/03/27 15:17:46	2.9
+++ ./pat.c	2010/05/16 11:12:57
@@ -332,6 +332,7 @@ 
         int Ppid = 0;
         int Vtype = 0;
         int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated
+        int Atypes[MAXDPIDS + 1] = { 0 };
         int Dpids[MAXDPIDS + 1] = { 0 };
         int Spids[MAXSPIDS + 1] = { 0 };
         uchar SubtitlingTypes[MAXSPIDS + 1] = { 0 };
@@ -358,9 +359,12 @@ 
                       break;
               case 3: // STREAMTYPE_11172_AUDIO
               case 4: // STREAMTYPE_13818_AUDIO
+              case 0x0F: // ISO/IEC 13818-7 Audio with ADTS transport sytax
+              case 0x11: // ISO/IEC 14496-3 Audio with LATM transport syntax
                       {
                       if (NumApids < MAXAPIDS) {
                          Apids[NumApids] = esPid;
+                         Atypes[NumApids] = stream.getStreamType();
                          SI::Descriptor *d;
                          for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
                              switch (d->getDescriptorTag()) {
@@ -481,7 +485,7 @@ 
                }
             }
         if (Setup.UpdateChannels >= 2) {
-           Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
+           Channel->SetPids(Vpid, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, DLangs, Spids, SLangs, Tpid);
            Channel->SetCaIds(CaDescriptors->CaIds());
            Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds);
            }
--- ./remux.c	2010/05/13 14:16:56	2.45
+++ ./remux.c	2010/05/16 12:23:12
@@ -321,7 +321,7 @@ 
      if (Vpid)
         i += MakeStream(buf + i, Channel->Vtype(), Vpid);
      for (int n = 0; Channel->Apid(n); n++) {
-         i += MakeStream(buf + i, 0x04, Channel->Apid(n));
+         i += MakeStream(buf + i, Channel->Atype(n), Channel->Apid(n));
          const char *Alang = Channel->Alang(n);
          i += MakeLanguageDescriptor(buf + i, Alang);
          }
@@ -510,6 +510,8 @@ 
                       break;
            case 0x03: // STREAMTYPE_11172_AUDIO
            case 0x04: // STREAMTYPE_13818_AUDIO
+           case 0x0F: // ISO/IEC 13818-7 Audio with ADTS transport sytax
+           case 0x11: // ISO/IEC 14496-3 Audio with LATM transport syntax
                       {
                       if (NumApids < MAXAPIDS) {
                          apids[NumApids] = stream.getPid();
--- ./vdr.5	2010/04/02 14:46:21	2.18
+++ ./vdr.5	2010/05/16 12:15:48
@@ -204,6 +204,13 @@ 
 
 .B ...:101=deu,102=eng+spa;103=deu,104=eng:...
 
+The audio type is appended with a separating '@' character, as in
+
+.B ...:101=deu@4,102=eng+spa@4,105=@4:...
+
+Note that if there is no language code, there still is the separating '='
+if there is an audio type.
+
 .TP
 .B TPID
 The teletext PID.