Add huffman decompression for EPG data
This commit is contained in:
parent
3c4211574f
commit
b0255bc6b0
1
Makefile
1
Makefile
|
@ -15,6 +15,7 @@ DEFS=-D_REENTRANT -D_TS_ERRNO -DHMT_PROTECT
|
|||
SRCS= descriptor.c \
|
||||
epg.c \
|
||||
file.c \
|
||||
huffman.c \
|
||||
main.c \
|
||||
util.c
|
||||
|
||||
|
|
24
descriptor.c
24
descriptor.c
|
@ -64,6 +64,22 @@ read_lstring(struct epg *epg, unsigned int *len)
|
|||
return c;
|
||||
}
|
||||
|
||||
static void
|
||||
uncompress_epg(char **epg, unsigned int *epglen)
|
||||
{
|
||||
char *new;
|
||||
unsigned int newlen;
|
||||
|
||||
if ((new = (char *)
|
||||
freeview_huffman_to_string((unsigned char *)(*epg),
|
||||
*epglen, &newlen)))
|
||||
{
|
||||
free(*epg);
|
||||
*epg = new;
|
||||
*epglen = newlen;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
read_descriptor(struct epg *epg, struct descriptor *d)
|
||||
{
|
||||
|
@ -78,6 +94,14 @@ read_descriptor(struct epg *epg, struct descriptor *d)
|
|||
read_lstring(epg, &d->content.d77.namelen);
|
||||
d->content.d77.text =
|
||||
read_lstring(epg, &d->content.d77.textlen);
|
||||
|
||||
if (*d->content.d77.name == 0x1f)
|
||||
uncompress_epg(&d->content.d77.name,
|
||||
&d->content.d77.namelen);
|
||||
|
||||
if (*d->content.d77.text == 0x1f)
|
||||
uncompress_epg(&d->content.d77.text,
|
||||
&d->content.d77.textlen);
|
||||
break;
|
||||
|
||||
case DS_COMPONENT:
|
||||
|
|
3
lint.h
3
lint.h
|
@ -40,6 +40,9 @@ void skip_descriptor(struct epg *, struct descriptor *);
|
|||
void dump_descriptor(struct descriptor *, int);
|
||||
void free_descriptor(struct descriptor *);
|
||||
|
||||
unsigned char *freeview_huffman_to_string(const unsigned char *, uint,
|
||||
unsigned int *);
|
||||
|
||||
#ifdef sun
|
||||
char *strcasestr (char *, char *);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue