diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-03 15:19:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-03 15:19:00 +0200 |
commit | 2f4526e55ec1bdf3ff0e2a71411cb2ae3bed6f5c (patch) | |
tree | ff2f47a18c65729236270c432edfb72dd6b004f9 | |
parent | 9e864aba12553c2bd5a157cf94b7fee49c6d88ce (diff) | |
download | vdr-2f4526e55ec1bdf3ff0e2a71411cb2ae3bed6f5c.tar.gz vdr-2f4526e55ec1bdf3ff0e2a71411cb2ae3bed6f5c.tar.bz2 |
Added support for multiple audio language codes in ISO639LanguageDescriptors to 'libsi'
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | libsi/descriptor.c | 24 | ||||
-rw-r--r-- | libsi/descriptor.h | 15 | ||||
-rw-r--r-- | libsi/headers.h | 6 | ||||
-rw-r--r-- | libsi/si.h | 8 |
5 files changed, 48 insertions, 7 deletions
@@ -3790,3 +3790,5 @@ Video Disk Recorder Revision History - Replaced the ':' delimiter between hour and minute in recording file names with a '.' under Linux, too. Existing recordings with ':' as delimiter will still work. - Implemented the SVDRP command MOVC (thanks to Andreas Brachold). +- Added support for multiple audio language codes in ISO639LanguageDescriptors to + 'libsi' (thanks to Marcel Wiesweg). 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<const descr_iso_639_language>(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<const descr_iso_639_language_loop>(); 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<const descr_pdc>(s, offset); diff --git a/libsi/descriptor.h b/libsi/descriptor.h index 73fd1059..476da3fb 100644 --- a/libsi/descriptor.h +++ b/libsi/descriptor.h @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: descriptor.h 1.12 2005/05/08 14:08:19 kls Exp $ + * $Id: descriptor.h 1.13 2005/09/03 15:17:35 kls Exp $ * * ***************************************************************************/ @@ -392,7 +392,18 @@ private: class ISO639LanguageDescriptor : public Descriptor { public: - char languageCode[4]; + char languageCode[4]; //for backwards compatibility + class Language : public LoopElement { + public: + virtual int getLength() { return sizeof(descr_iso_639_language_loop); } + char languageCode[4]; + AudioType getAudioType(); + protected: + virtual void Parse(); + private: + const descr_iso_639_language_loop *s; + }; + StructureLoop<Language> languageLoop; protected: virtual void Parse(); private: diff --git a/libsi/headers.h b/libsi/headers.h index ff3e0f95..69350cdd 100644 --- a/libsi/headers.h +++ b/libsi/headers.h @@ -10,7 +10,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: headers.h 1.4 2004/02/22 11:12:46 kls Exp $ + * $Id: headers.h 1.5 2005/09/03 15:18:16 kls Exp $ * * ***************************************************************************/ @@ -821,9 +821,13 @@ struct descr_ca { struct descr_iso_639_language { u_char descriptor_tag :8; u_char descriptor_length :8; +}; + +struct descr_iso_639_language_loop { u_char lang_code1 :8; u_char lang_code2 :8; u_char lang_code3 :8; + u_char audio_type :8; }; /* 0x13 carousel_identifier_descriptor */ @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.h 1.11 2004/10/16 09:58:10 kls Exp $ + * $Id: si.h 1.12 2005/09/03 15:19:00 kls Exp $ * * ***************************************************************************/ @@ -166,6 +166,12 @@ enum LinkageType { LinkageTypeInformationService = 0x01, LinkageTypeTSContainingSsuBatOrNit = 0x0A }; +enum AudioType { AudioTypeUndefined = 0x00, + AudioTypeCleanEffects = 0x01, + AudioTypeHearingImpaired = 0x02, + AudioTypeVisualImpairedCommentary = 0x03 + }; + /* Some principles: - Objects that return references to other objects contained in their data must make sure that the returned objects have been parsed. |