From patchwork Tue May 18 20:00:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jose Alberto Reguero X-Patchwork-Id: 12814 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.69) (envelope-from ) id 1OESxs-0001tI-HX for vdr@linuxtv.org; Tue, 18 May 2010 22:00:36 +0200 X-tubIT-Incoming-IP: 213.4.138.2 Received: from impaqm2.telefonica.net ([213.4.138.2]) by mail.tu-berlin.de (exim-4.69/mailfrontend-a) with esmtp for id 1OESxr-0002TY-Al; Tue, 18 May 2010 22:00:32 +0200 Received: from IMPmailhost6.adm.correo ([10.20.102.127]) by IMPaqm2.telefonica.net with bizsmtp id K5rf1e02B2kvMAa3M80WdK; Tue, 18 May 2010 22:00:30 +0200 Received: from jar.dominio ([80.25.230.35]) by IMPmailhost6.adm.correo with BIZ IMP id K80U1e00G0mULeg1m80VXX; Tue, 18 May 2010 22:00:29 +0200 X-TE-authinfo: authemail="jareguero$telefonica.net" |auth_email="jareguero@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" From: Jose Alberto Reguero To: VDR Mailing List Date: Tue, 18 May 2010 22:00:27 +0200 User-Agent: KMail/1.13.2 (Linux/2.6.32.11-99.fc12.x86_64; KDE/4.4.2; x86_64; ; ) References: <935652.18842.qm@web23205.mail.ird.yahoo.com> <4BF2EDF9.4000302@ventoso.org> <4BF2EF76.6040702@ventoso.org> In-Reply-To: <4BF2EF76.6040702@ventoso.org> MIME-Version: 1.0 Message-Id: <201005182200.28123.jareguero@telefonica.net> X-tubIT-Score: 0.0 () X-PMX-Version: 5.5.4.371499, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.5.18.194518 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_10000_PLUS 0, FROM_NAME_PHRASE 0, WEBMAIL_RCVD 0, WEBMAIL_SOURCE 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __USER_AGENT 0' X-LSpam-Score: -3.3 (---) X-LSpam-Report: No, score=-3.3 required=5.0 tests=AWL=0.250, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1 autolearn=ham Subject: Re: [vdr] vdr and aac support X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2010 20:06:57 -0000 Status: O X-Status: X-Keywords: X-UID: 22953 El Martes, 18 de Mayo de 2010, Luca Olivetti escribió: > Al 18/05/10 21:43, En/na Luca Olivetti ha escrit: > > (i.e. it only adds SI::AACDescriptorTag) > > > > I must have missed some patch along the way :-/ > > Ok, they were in the "Recording DVB-T HD infrance" (sic). > It appears that spain is using the same standard. > > Bye Here is a patch based in Klaus aac pacth that add support for eac3 sound in vdr. Jose Alberto Sólo en vdr-1.7.14.new/: audio.o diff -ur vdr-1.7.14/channels.c vdr-1.7.14.new/channels.c --- vdr-1.7.14/channels.c 2010-02-21 14:36:04.000000000 +0100 +++ vdr-1.7.14.new/channels.c 2010-05-18 18:54:57.000000000 +0200 @@ -12,6 +12,7 @@ #include "device.h" #include "epg.h" #include "timers.h" +#include "libsi/si.h" // IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d' // format characters in order to allow any number of blanks after a numeric @@ -270,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++; @@ -286,32 +294,32 @@ 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, char ALangs[][MAXLANGCODE2], int *Dpids, int *Dtypes, 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(dpids, Dpids, dlangs, DLangs) | IntArraysDiffer(dtypes, Dtypes) | 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); if (dpids[0]) { *q++ = ';'; - q += IntArrayToString(q, dpids, 10, dlangs); + q += IntArrayToString(q, dpids, 10, dlangs, dtypes); } *q = 0; q = NewApidsBuf; q += IntArrayToString(q, Apids, 10, ALangs); if (Dpids[0]) { *q++ = ';'; - q += IntArrayToString(q, Dpids, 10, DLangs); + q += IntArrayToString(q, Dpids, 10, DLangs, Dtypes); } *q = 0; const int SBufferSize = MAXSPIDS * (5 + 1 + MAXLANGCODE2) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod', +10: paranoia @@ -335,6 +343,7 @@ apids[MAXAPIDS] = 0; for (int i = 0; i < MAXDPIDS; i++) { dpids[i] = Dpids[i]; + dtypes[i] = Dtypes[i]; strn0cpy(dlangs[i], DLangs[i], MAXLANGCODE2); } dpids[MAXDPIDS] = 0; @@ -484,13 +493,13 @@ 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); if (Channel->dpids[0]) { *q++ = ';'; - q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs); + q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs, Channel->dtypes); } *q = 0; char caidbuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia @@ -547,6 +556,7 @@ vtype = 0; apids[0] = 0; dpids[0] = 0; + dtypes[0] = 0; ok = false; if (parambuf && sourcebuf && vpidbuf && apidbuf) { parameters = parambuf; @@ -600,9 +610,15 @@ char *strtok_next; while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { if (NumDpids < MAXDPIDS) { + dtypes[NumDpids] = SI::AC3DescriptorTag; // backwards compatibility char *l = strchr(q, '='); if (l) { *l++ = 0; + char *t = strchr(l, '@'); + if (t) { + *t++ = 0; + dtypes[NumDpids] = strtol(t, NULL, 10); + } strn0cpy(dlangs[NumDpids], l, MAXLANGCODE2); } else @@ -614,6 +630,7 @@ p = NULL; } dpids[NumDpids] = 0; + dtypes[NumDpids] = 0; } if (caidbuf) { diff -ur vdr-1.7.14/channels.h vdr-1.7.14.new/channels.h --- vdr-1.7.14/channels.h 2010-03-07 14:47:13.000000000 +0100 +++ vdr-1.7.14.new/channels.h 2010-05-18 17:39:09.000000000 +0200 @@ -106,6 +106,7 @@ int apids[MAXAPIDS + 1]; // list is zero-terminated char alangs[MAXAPIDS][MAXLANGCODE2]; int dpids[MAXDPIDS + 1]; // list is zero-terminated + int dtypes[MAXAPIDS + 1]; // list is zero-terminated char dlangs[MAXDPIDS][MAXLANGCODE2]; int spids[MAXSPIDS + 1]; // list is zero-terminated char slangs[MAXSPIDS][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 Dtype(int i) const { return (0 <= i && i < MAXAPIDS) ? dtypes[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, char ALangs[][MAXLANGCODE2], int *Dpids, int *Dtypes, 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); diff -ur vdr-1.7.14/pat.c vdr-1.7.14.new/pat.c --- vdr-1.7.14/pat.c 2010-03-06 13:00:30.000000000 +0100 +++ vdr-1.7.14.new/pat.c 2010-05-18 17:47:29.000000000 +0200 @@ -333,6 +333,7 @@ int Vtype = 0; int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated int Dpids[MAXDPIDS + 1] = { 0 }; + int Dtypes[MAXDPIDS + 1] = { 0 }; int Spids[MAXSPIDS + 1] = { 0 }; uchar SubtitlingTypes[MAXSPIDS + 1] = { 0 }; uint16_t CompositionPageIds[MAXSPIDS + 1] = { 0 }; @@ -395,12 +396,15 @@ //XXX case 8: // STREAMTYPE_13818_DSMCC { int dpid = 0; + int dtype = 0; char lang[MAXLANGCODE1] = { 0 }; SI::Descriptor *d; for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) { switch (d->getDescriptorTag()) { case SI::AC3DescriptorTag: + case SI::EnhancedAC3DescriptorTag: dpid = esPid; + dtype = d->getDescriptorTag(); ProcessCaDescriptors = true; break; case SI::SubtitlingDescriptorTag: @@ -441,6 +445,7 @@ if (dpid) { if (NumDpids < MAXDPIDS) { Dpids[NumDpids] = dpid; + Dtypes[NumDpids] = dtype; strn0cpy(DLangs[NumDpids], lang, MAXLANGCODE1); NumDpids++; } @@ -480,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, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid); Channel->SetCaIds(CaDescriptors->CaIds()); Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds); } diff -ur vdr-1.7.14/remux.c vdr-1.7.14.new/remux.c --- vdr-1.7.14/remux.c 2010-02-28 15:42:07.000000000 +0100 +++ vdr-1.7.14.new/remux.c 2010-05-18 17:51:38.000000000 +0200 @@ -188,10 +188,10 @@ return i; } -int cPatPmtGenerator::MakeAC3Descriptor(uchar *Target) +int cPatPmtGenerator::MakeAC3Descriptor(uchar *Target, int dtype) { int i = 0; - Target[i++] = SI::AC3DescriptorTag; + Target[i++] = dtype; Target[i++] = 0x01; // length Target[i++] = 0x00; IncEsInfoLength(i); @@ -323,7 +323,7 @@ } for (int n = 0; Channel->Dpid(n); n++) { i += MakeStream(buf + i, 0x06, Channel->Dpid(n)); - i += MakeAC3Descriptor(buf + i); + i += MakeAC3Descriptor(buf + i, Channel->Dtype(n)); i += MakeLanguageDescriptor(buf + i, Channel->Dlang(n)); } for (int n = 0; Channel->Spid(n); n++) { @@ -546,13 +546,16 @@ case 0x06: // STREAMTYPE_13818_PES_PRIVATE { int dpid = 0; + int dtype = 0; char lang[MAXLANGCODE1] = ""; SI::Descriptor *d; for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) { switch (d->getDescriptorTag()) { case SI::AC3DescriptorTag: + case SI::EnhancedAC3DescriptorTag: dbgpatpmt(" AC3"); dpid = stream.getPid(); + dtype = d->getDescriptorTag(); break; case SI::SubtitlingDescriptorTag: dbgpatpmt(" subtitling"); @@ -599,7 +602,7 @@ if (dpid) { if (NumDpids < MAXDPIDS) { dpids[NumDpids] = dpid; - dtypes[NumDpids] = stream.getStreamType(); + dtypes[NumDpids] = dtype; strn0cpy(dlangs[NumDpids], lang, sizeof(dlangs[NumDpids])); if (updatePrimaryDevice && Setup.UseDolbyDigital) cDevice::PrimaryDevice()->SetAvailableTrack(ttDolby, NumDpids, dpid, lang); diff -ur vdr-1.7.14/remux.h vdr-1.7.14.new/remux.h --- vdr-1.7.14/remux.h 2010-01-29 17:51:26.000000000 +0100 +++ vdr-1.7.14.new/remux.h 2010-05-18 17:48:37.000000000 +0200 @@ -168,7 +168,7 @@ void IncEsInfoLength(int Length); protected: int MakeStream(uchar *Target, uchar Type, int Pid); - int MakeAC3Descriptor(uchar *Target); + int MakeAC3Descriptor(uchar *Target, int dtype); int MakeSubtitlingDescriptor(uchar *Target, const char *Language, uchar SubtitlingType, uint16_t CompositionPageId, uint16_t AncillaryPageId); int MakeLanguageDescriptor(uchar *Target, const char *Language); int MakeCRC(uchar *Target, const uchar *Data, int Length);