Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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
vlc-2-2
Commits
b426aaa9
Commit
b426aaa9
authored
Apr 16, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checked CC parity.
Based on an initial patch of Pdraig Brady.
parent
bcd84fbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
modules/codec/cc.c
modules/codec/cc.c
+18
-4
No files found.
modules/codec/cc.c
View file @
b426aaa9
...
...
@@ -604,8 +604,22 @@ static void Eia608RollUp( eia608_t *h )
/* Reset current row */
Eia608ClearScreenRow
(
h
,
i_screen
,
h
->
cursor
.
i_row
);
}
static
void
Eia608ParseChannel
(
eia608_t
*
h
,
uint8_t
d
1
)
static
void
Eia608ParseChannel
(
eia608_t
*
h
,
uint8_t
d
[
2
]
)
{
/* Check odd parity */
static
const
int
p4
[
16
]
=
{
0
,
1
,
1
,
0
,
1
,
0
,
0
,
1
,
1
,
0
,
0
,
1
,
0
,
1
,
1
,
0
};
if
(
p4
[
d
[
0
]
&
0xf
]
==
p4
[
d
[
0
]
>>
4
]
||
p4
[
d
[
1
]
&
0xf
]
==
p4
[
d
[
1
]
>>
4
]
)
{
h
->
i_channel
=
-
1
;
return
;
}
/* */
const
int
d1
=
d
[
0
]
&
0x7f
;
const
int
d2
=
d
[
1
]
&
0x7f
;
if
(
d1
==
0x14
)
h
->
i_channel
=
1
;
else
if
(
d1
==
0x1c
)
...
...
@@ -1069,14 +1083,14 @@ static void Eia608Init( eia608_t *h )
}
static
bool
Eia608Parse
(
eia608_t
*
h
,
int
i_channel_selected
,
const
uint8_t
data
[
2
]
)
{
const
uint8_t
d1
=
data
[
0
]
&
0x7f
;
/* Removed parity bit
TODO we might want to check them
*/
const
uint8_t
d1
=
data
[
0
]
&
0x7f
;
/* Removed parity bit */
const
uint8_t
d2
=
data
[
1
]
&
0x7f
;
bool
b_screen_changed
=
false
;
if
(
d1
==
0
&&
d2
==
0
)
return
false
;
/* Ignore padding */
return
false
;
/* Ignore padding
(parity check are sometimes invalid on them)
*/
Eia608ParseChannel
(
h
,
d
1
);
Eia608ParseChannel
(
h
,
d
ata
);
if
(
h
->
i_channel
!=
i_channel_selected
)
return
false
;
//fprintf( stderr, "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC %x %x\n", data[0], data[1] );
...
...
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