1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Added support for multiple audio language codes in ISO639LanguageDescriptors to 'libsi'

This commit is contained in:
Klaus Schmidinger 2005-09-03 15:19:00 +02:00
parent 9e864aba12
commit 2f4526e55e
5 changed files with 48 additions and 7 deletions

View File

@ -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).

View File

@ -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);

View File

@ -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]; //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:

View File

@ -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 */

View File

@ -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.