Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
d3a8a23d
Commit
d3a8a23d
authored
Oct 11, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CC: use c99, removed dummy Eia608Exit
parent
b389b4f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
21 deletions
+7
-21
modules/codec/cc.c
modules/codec/cc.c
+7
-21
No files found.
modules/codec/cc.c
View file @
d3a8a23d
...
@@ -135,7 +135,6 @@ typedef struct
...
@@ -135,7 +135,6 @@ typedef struct
static
void
Eia608Init
(
eia608_t
*
);
static
void
Eia608Init
(
eia608_t
*
);
static
bool
Eia608Parse
(
eia608_t
*
h
,
int
i_channel_selected
,
const
uint8_t
data
[
2
]
);
static
bool
Eia608Parse
(
eia608_t
*
h
,
int
i_channel_selected
,
const
uint8_t
data
[
2
]
);
static
char
*
Eia608Text
(
eia608_t
*
h
,
bool
b_html
);
static
char
*
Eia608Text
(
eia608_t
*
h
,
bool
b_html
);
static
void
Eia608Exit
(
eia608_t
*
);
/* It will be enough up to 63 B frames, which is far too high for
/* It will be enough up to 63 B frames, which is far too high for
* broadcast environment */
* broadcast environment */
...
@@ -243,11 +242,9 @@ static void Close( vlc_object_t *p_this )
...
@@ -243,11 +242,9 @@ static void Close( vlc_object_t *p_this )
{
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i
;
for
(
i
=
0
;
i
<
p_sys
->
i_block
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
p_sys
->
i_block
;
i
++
)
block_Release
(
p_sys
->
pp_block
[
i
]
);
block_Release
(
p_sys
->
pp_block
[
i
]
);
Eia608Exit
(
&
p_sys
->
eia608
);
free
(
p_sys
);
free
(
p_sys
);
}
}
...
@@ -271,7 +268,6 @@ static block_t *Pop( decoder_t *p_dec )
...
@@ -271,7 +268,6 @@ static block_t *Pop( decoder_t *p_dec )
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
block_t
*
p_block
;
block_t
*
p_block
;
int
i_index
;
int
i_index
;
int
i
;
/* XXX Cc captions data are OUT OF ORDER (because we receive them in the bitstream
/* XXX Cc captions data are OUT OF ORDER (because we receive them in the bitstream
* order (ie ordered by video picture dts) instead of the display order.
* order (ie ordered by video picture dts) instead of the display order.
* We will simulate a simple IPB buffer scheme
* We will simulate a simple IPB buffer scheme
...
@@ -288,7 +284,7 @@ static block_t *Pop( decoder_t *p_dec )
...
@@ -288,7 +284,7 @@ static block_t *Pop( decoder_t *p_dec )
p_block
=
p_sys
->
pp_block
[
i_index
=
0
];
p_block
=
p_sys
->
pp_block
[
i_index
=
0
];
if
(
p_block
->
i_pts
>
VLC_TS_INVALID
)
if
(
p_block
->
i_pts
>
VLC_TS_INVALID
)
{
{
for
(
i
=
1
;
i
<
p_sys
->
i_block
-
1
;
i
++
)
for
(
i
nt
i
=
1
;
i
<
p_sys
->
i_block
-
1
;
i
++
)
{
{
if
(
p_sys
->
pp_block
[
i
]
->
i_pts
>
VLC_TS_INVALID
&&
p_block
->
i_pts
>
VLC_TS_INVALID
&&
if
(
p_sys
->
pp_block
[
i
]
->
i_pts
>
VLC_TS_INVALID
&&
p_block
->
i_pts
>
VLC_TS_INVALID
&&
p_sys
->
pp_block
[
i
]
->
i_pts
<
p_block
->
i_pts
)
p_sys
->
pp_block
[
i
]
->
i_pts
<
p_block
->
i_pts
)
...
@@ -426,7 +422,6 @@ static void Eia608Cursor( eia608_t *h, int dx )
...
@@ -426,7 +422,6 @@ static void Eia608Cursor( eia608_t *h, int dx )
static
void
Eia608ClearScreenRowX
(
eia608_t
*
h
,
int
i_screen
,
int
i_row
,
int
x
)
static
void
Eia608ClearScreenRowX
(
eia608_t
*
h
,
int
i_screen
,
int
i_row
,
int
x
)
{
{
eia608_screen
*
screen
=
&
h
->
screen
[
i_screen
];
eia608_screen
*
screen
=
&
h
->
screen
[
i_screen
];
int
i
;
if
(
x
==
0
)
if
(
x
==
0
)
{
{
...
@@ -435,7 +430,7 @@ static void Eia608ClearScreenRowX( eia608_t *h, int i_screen, int i_row, int x )
...
@@ -435,7 +430,7 @@ static void Eia608ClearScreenRowX( eia608_t *h, int i_screen, int i_row, int x )
else
else
{
{
screen
->
row_used
[
i_row
]
=
false
;
screen
->
row_used
[
i_row
]
=
false
;
for
(
i
=
0
;
i
<
x
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
x
;
i
++
)
{
{
if
(
screen
->
characters
[
i_row
][
i
]
!=
' '
||
if
(
screen
->
characters
[
i_row
][
i
]
!=
' '
||
screen
->
colors
[
i_row
][
i
]
!=
EIA608_COLOR_DEFAULT
||
screen
->
colors
[
i_row
][
i
]
!=
EIA608_COLOR_DEFAULT
||
...
@@ -462,8 +457,7 @@ static void Eia608ClearScreenRow( eia608_t *h, int i_screen, int i_row )
...
@@ -462,8 +457,7 @@ static void Eia608ClearScreenRow( eia608_t *h, int i_screen, int i_row )
static
void
Eia608ClearScreen
(
eia608_t
*
h
,
int
i_screen
)
static
void
Eia608ClearScreen
(
eia608_t
*
h
,
int
i_screen
)
{
{
int
i
;
for
(
int
i
=
0
;
i
<
EIA608_SCREEN_ROWS
;
i
++
)
for
(
i
=
0
;
i
<
EIA608_SCREEN_ROWS
;
i
++
)
Eia608ClearScreenRow
(
h
,
i_screen
,
i
);
Eia608ClearScreenRow
(
h
,
i_screen
,
i
);
}
}
...
@@ -542,7 +536,6 @@ static void Eia608RollUp( eia608_t *h )
...
@@ -542,7 +536,6 @@ static void Eia608RollUp( eia608_t *h )
eia608_screen
*
screen
=
&
h
->
screen
[
i_screen
];
eia608_screen
*
screen
=
&
h
->
screen
[
i_screen
];
int
keep_lines
;
int
keep_lines
;
int
i
;
/* Window size */
/* Window size */
if
(
h
->
mode
==
EIA608_MODE_ROLLUP_2
)
if
(
h
->
mode
==
EIA608_MODE_ROLLUP_2
)
...
@@ -558,11 +551,11 @@ static void Eia608RollUp( eia608_t *h )
...
@@ -558,11 +551,11 @@ static void Eia608RollUp( eia608_t *h )
h
->
cursor
.
i_column
=
0
;
h
->
cursor
.
i_column
=
0
;
/* Erase lines above our window */
/* Erase lines above our window */
for
(
i
=
0
;
i
<
h
->
cursor
.
i_row
-
keep_lines
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
h
->
cursor
.
i_row
-
keep_lines
;
i
++
)
Eia608ClearScreenRow
(
h
,
i_screen
,
i
);
Eia608ClearScreenRow
(
h
,
i_screen
,
i
);
/* Move up */
/* Move up */
for
(
i
=
0
;
i
<
keep_lines
-
1
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
keep_lines
-
1
;
i
++
)
{
{
const
int
i_row
=
h
->
cursor
.
i_row
-
keep_lines
+
i
+
1
;
const
int
i_row
=
h
->
cursor
.
i_row
-
keep_lines
+
i
+
1
;
if
(
i_row
<
0
)
if
(
i_row
<
0
)
...
@@ -1087,7 +1080,6 @@ static char *Eia608Text( eia608_t *h, bool b_html )
...
@@ -1087,7 +1080,6 @@ static char *Eia608Text( eia608_t *h, bool b_html )
struct
eia608_screen
*
screen
=
&
h
->
screen
[
h
->
i_screen
];
struct
eia608_screen
*
screen
=
&
h
->
screen
[
h
->
i_screen
];
bool
b_first
=
true
;
bool
b_first
=
true
;
char
*
psz
;
char
*
psz
;
int
i
;
/* We allocate a buffer big enough for normal case */
/* We allocate a buffer big enough for normal case */
psz
=
malloc
(
i_size
);
psz
=
malloc
(
i_size
);
...
@@ -1096,7 +1088,7 @@ static char *Eia608Text( eia608_t *h, bool b_html )
...
@@ -1096,7 +1088,7 @@ static char *Eia608Text( eia608_t *h, bool b_html )
*
psz
=
'\0'
;
*
psz
=
'\0'
;
if
(
b_html
)
if
(
b_html
)
Eia608Strlcat
(
psz
,
"<text>"
,
i_size
);
Eia608Strlcat
(
psz
,
"<text>"
,
i_size
);
for
(
i
=
0
;
i
<
EIA608_SCREEN_ROWS
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
EIA608_SCREEN_ROWS
;
i
++
)
{
{
if
(
!
screen
->
row_used
[
i
]
)
if
(
!
screen
->
row_used
[
i
]
)
continue
;
continue
;
...
@@ -1111,9 +1103,3 @@ static char *Eia608Text( eia608_t *h, bool b_html )
...
@@ -1111,9 +1103,3 @@ static char *Eia608Text( eia608_t *h, bool b_html )
Eia608Strlcat
(
psz
,
"</text>"
,
i_size
);
Eia608Strlcat
(
psz
,
"</text>"
,
i_size
);
return
psz
;
return
psz
;
}
}
static
void
Eia608Exit
(
eia608_t
*
h
)
{
VLC_UNUSED
(
h
);
}
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