From 2f4526e55ec1bdf3ff0e2a71411cb2ae3bed6f5c Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 3 Sep 2005 15:19:00 +0200 Subject: Added support for multiple audio language codes in ISO639LanguageDescriptors to 'libsi' --- libsi/descriptor.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'libsi/descriptor.c') diff --git a/libsi/descriptor.c b/libsi/descriptor.c index 207b7c25..cc3a0169 100644 --- a/libsi/descriptor.c +++ b/libsi/descriptor.c @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: descriptor.c 1.14 2004/10/16 09:51:05 kls Exp $ + * $Id: descriptor.c 1.15 2005/09/03 15:16:49 kls Exp $ * * ***************************************************************************/ @@ -655,14 +655,32 @@ LinkageType LinkageDescriptor::getLinkageType() const { } void ISO639LanguageDescriptor::Parse() { - unsigned int offset=0; - data.setPointerAndOffset(s, offset); + languageLoop.setData(data+sizeof(descr_iso_639_language), getLength()-sizeof(descr_iso_639_language)); + + //all this is for backwards compatibility only + Loop::Iterator it; + Language first; + if (languageLoop.getNext(first, it)) { + languageCode[0]=first.languageCode[0]; + languageCode[1]=first.languageCode[1]; + languageCode[2]=first.languageCode[2]; + languageCode[3]=0; + } else + languageCode[0]=0; +} + +void ISO639LanguageDescriptor::Language::Parse() { + s=data.getData(); languageCode[0]=s->lang_code1; languageCode[1]=s->lang_code2; languageCode[2]=s->lang_code3; languageCode[3]=0; } +AudioType ISO639LanguageDescriptor::Language::getAudioType() { + return (AudioType)s->audio_type; +} + void PDCDescriptor::Parse() { unsigned int offset=0; data.setPointerAndOffset(s, offset); -- cgit v1.2.3