Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
libdvbpsi
Commits
bcd7b664
Commit
bcd7b664
authored
Jul 18, 2006
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix descriptor 0x0a to match newer specs. Note that this will break binary compatibility.
TODO: Update test code
parent
db622d74
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
20 deletions
+29
-20
src/descriptors/dr_0a.c
src/descriptors/dr_0a.c
+21
-16
src/descriptors/dr_0a.h
src/descriptors/dr_0a.h
+8
-4
No files found.
src/descriptors/dr_0a.c
View file @
bcd7b664
/*****************************************************************************
* dr_0a.c
* (c)2001-2002 VideoLAN
* $Id
: dr_0a.c,v 1.4 2003/07/25 20:20:40 fenrir Exp
$
* $Id$
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
...
...
@@ -47,6 +47,7 @@
dvbpsi_iso639_dr_t
*
dvbpsi_DecodeISO639Dr
(
dvbpsi_descriptor_t
*
p_descriptor
)
{
dvbpsi_iso639_dr_t
*
p_decoded
;
int
i
;
/* Check the tag */
if
(
p_descriptor
->
i_tag
!=
0x0a
)
...
...
@@ -68,7 +69,7 @@ dvbpsi_iso639_dr_t * dvbpsi_DecodeISO639Dr(dvbpsi_descriptor_t * p_descriptor)
}
/* Decode data and check the length */
if
((
p_descriptor
->
i_length
<
1
)
||
(
(
p_descriptor
->
i_length
-
1
)
%
3
!=
0
))
if
((
p_descriptor
->
i_length
<
1
)
||
(
p_descriptor
->
i_length
%
4
!=
0
))
{
DVBPSI_ERROR_ARG
(
"dr_0a decoder"
,
"bad length (%d)"
,
p_descriptor
->
i_length
);
...
...
@@ -76,13 +77,15 @@ dvbpsi_iso639_dr_t * dvbpsi_DecodeISO639Dr(dvbpsi_descriptor_t * p_descriptor)
return
NULL
;
}
p_decoded
->
i_audio_type
=
p_descriptor
->
p_data
[
p_descriptor
->
i_length
-
1
];
p_decoded
->
i_code_count
=
(
p_descriptor
->
i_length
-
1
)
/
3
;
if
(
p_decoded
->
i_code_count
)
memcpy
(
p_decoded
->
i_iso_639_code
,
p_descriptor
->
p_data
,
p_descriptor
->
i_length
-
1
);
p_decoded
->
i_code_count
=
p_descriptor
->
i_length
/
4
;
i
=
0
;
while
(
i
<
p_decoded
->
i_code_count
)
{
p_decoded
->
code
[
i
].
iso_639_code
[
0
]
=
p_descriptor
->
p_data
[
i
*
4
];
p_decoded
->
code
[
i
].
iso_639_code
[
1
]
=
p_descriptor
->
p_data
[
i
*
4
+
1
];
p_decoded
->
code
[
i
].
iso_639_code
[
2
]
=
p_descriptor
->
p_data
[
i
*
4
+
2
];
p_decoded
->
code
[
i
].
i_audio_type
=
p_descriptor
->
p_data
[
i
*
4
+
3
];
i
++
;
}
p_descriptor
->
p_decoded
=
(
void
*
)
p_decoded
;
return
p_decoded
;
...
...
@@ -97,17 +100,19 @@ dvbpsi_descriptor_t * dvbpsi_GenISO639Dr(dvbpsi_iso639_dr_t * p_decoded,
{
/* Create the descriptor */
dvbpsi_descriptor_t
*
p_descriptor
=
dvbpsi_NewDescriptor
(
0x0a
,
p_decoded
->
i_code_count
*
3
+
1
,
NULL
);
dvbpsi_NewDescriptor
(
0x0a
,
p_decoded
->
i_code_count
*
4
,
NULL
);
if
(
p_descriptor
)
{
/* Encode data */
p_descriptor
->
p_data
[
p_descriptor
->
i_length
-
1
]
=
p_decoded
->
i_audio_type
;
if
(
p_decoded
->
i_code_count
)
memcpy
(
p_descriptor
->
p_data
,
p_decoded
->
i_iso_639_code
,
p_descriptor
->
i_length
-
1
);
int
i
=
0
;
while
(
i
<
p_decoded
->
i_code_count
)
{
p_descriptor
->
p_data
[
i
*
4
]
=
p_decoded
->
code
[
i
].
iso_639_code
[
0
];
p_descriptor
->
p_data
[
i
*
4
+
1
]
=
p_decoded
->
code
[
i
].
iso_639_code
[
1
];
p_descriptor
->
p_data
[
i
*
4
+
2
]
=
p_decoded
->
code
[
i
].
iso_639_code
[
2
];
p_descriptor
->
p_data
[
i
*
4
+
3
]
=
p_decoded
->
code
[
i
].
i_audio_type
;
i
++
;
}
if
(
b_duplicate
)
{
/* Duplicate decoded data */
...
...
src/descriptors/dr_0a.h
View file @
bcd7b664
/*****************************************************************************
* dr_0a.h
* (c)2001-2002 VideoLAN
* $Id
: dr_0a.h,v 1.2 2002/05/10 23:50:36 bozo Exp
$
* $Id$
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
...
...
@@ -39,6 +39,8 @@
extern
"C"
{
#endif
#define DR_0A_API_VER 2
typedef
uint8_t
iso_639_language_code_t
[
3
];
/*****************************************************************************
* dvbpsi_iso639_dr_t
...
...
@@ -58,8 +60,10 @@ typedef struct dvbpsi_iso639_dr_s
{
uint8_t
i_code_count
;
/*!< length of the i_iso_639_code
array */
uint8_t
i_iso_639_code
[
252
];
/*!< ISO_639_language_code */
struct
{
iso_639_language_code_t
iso_639_code
;
/*!< ISO_639_language_code */
uint8_t
i_audio_type
;
/*!< audio_type */
}
code
[
64
];
}
dvbpsi_iso639_dr_t
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment