summaryrefslogtreecommitdiff
path: root/remux.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-04-18 13:44:56 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2010-04-18 13:44:56 +0200
commit515966cdeae7e0a33911bf467931e803ac392014 (patch)
treedc9a3c5385297a6e671d8aff9e70b85131562a68 /remux.c
parent512522f259a5ef4836b5d03030d737515c0787d0 (diff)
downloadvdr-515966cdeae7e0a33911bf467931e803ac392014.tar.gz
vdr-515966cdeae7e0a33911bf467931e803ac392014.tar.bz2
Fixed generating PMT language descriptors for multi language PIDs
Diffstat (limited to 'remux.c')
-rw-r--r--remux.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/remux.c b/remux.c
index 4b845a13..3ac83dd7 100644
--- a/remux.c
+++ b/remux.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remux.c 2.43 2010/04/05 09:32:57 kls Exp $
+ * $Id: remux.c 2.44 2010/04/18 13:40:20 kls Exp $
*/
#include "remux.h"
@@ -219,11 +219,17 @@ int cPatPmtGenerator::MakeLanguageDescriptor(uchar *Target, const char *Language
{
int i = 0;
Target[i++] = SI::ISO639LanguageDescriptorTag;
- Target[i++] = 0x04; // length
- Target[i++] = *Language++;
- Target[i++] = *Language++;
- Target[i++] = *Language++;
- Target[i++] = 0x01; // audio type
+ int Length = i++;
+ Target[Length] = 0x00; // length
+ for (const char *End = Language + strlen(Language); Language < End; ) {
+ Target[i++] = *Language++;
+ Target[i++] = *Language++;
+ Target[i++] = *Language++;
+ Target[i++] = 0x01; // audio type
+ Target[Length] += 0x04; // length
+ if (*Language == '+')
+ Language++;
+ }
IncEsInfoLength(i);
return i;
}
@@ -318,8 +324,6 @@ void cPatPmtGenerator::GeneratePmt(const cChannel *Channel)
i += MakeStream(buf + i, 0x04, Channel->Apid(n));
const char *Alang = Channel->Alang(n);
i += MakeLanguageDescriptor(buf + i, Alang);
- if (Alang[3] == '+')
- i += MakeLanguageDescriptor(buf + i, Alang + 3);
}
for (int n = 0; Channel->Dpid(n); n++) {
i += MakeStream(buf + i, 0x06, Channel->Dpid(n));