Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
4d9ab11d
Commit
4d9ab11d
authored
May 11, 2001
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed a deadlock in spudec.
parent
b1f3c7d6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
40 deletions
+57
-40
ChangeLog
ChangeLog
+2
-1
src/spu_decoder/spu_decoder.c
src/spu_decoder/spu_decoder.c
+49
-35
src/spu_decoder/spu_decoder.h
src/spu_decoder/spu_decoder.h
+6
-4
No files found.
ChangeLog
View file @
4d9ab11d
...
@@ -3,9 +3,10 @@
...
@@ -3,9 +3,10 @@
#===================#
#===================#
HEAD
HEAD
*
Fixed
a
deadlock
in
spudec
.
*
Added
SPU
cropping
.
*
Added
SPU
cropping
.
*
Gnome
interface
segfault
fix
.
*
Gnome
interface
segfault
fix
.
*
BeOS
interface
segfault
fix
by
AnEvilYak
(
what
's you real name btw?)
.
*
BeOS
interface
segfault
fix
by
Rene
Gollent
<
rgollent
@
u
.
arizona
.
edu
>
.
*
Fixed
an
aspect
ratio
issue
in
the
SPU
decoder
,
and
optimized
the
*
Fixed
an
aspect
ratio
issue
in
the
SPU
decoder
,
and
optimized
the
SPU
renderer
.
SPU
renderer
.
*
Speed
optimization
in
the
handling
of
the
unusual
ephemer
DVD
subtitles
.
*
Speed
optimization
in
the
handling
of
the
unusual
ephemer
DVD
subtitles
.
...
...
src/spu_decoder/spu_decoder.c
View file @
4d9ab11d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread
* spu_decoder.c : spu decoder thread
*****************************************************************************
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* Copyright (C) 2000 VideoLAN
* $Id: spu_decoder.c,v 1.4
4 2001/05/10 06:47:3
1 sam Exp $
* $Id: spu_decoder.c,v 1.4
5 2001/05/11 15:10:0
1 sam Exp $
*
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Authors: Samuel Hocevar <sam@zoy.org>
*
*
...
@@ -271,6 +271,7 @@ static void ParsePacket( spudec_thread_t *p_spudec )
...
@@ -271,6 +271,7 @@ static void ParsePacket( spudec_thread_t *p_spudec )
{
{
subpicture_t
*
p_spu
;
subpicture_t
*
p_spu
;
u8
*
p_src
;
u8
*
p_src
;
unsigned
int
i_offset
;
intf_WarnMsg
(
3
,
"spudec: trying to gather a 0x%.2x long subtitle"
,
intf_WarnMsg
(
3
,
"spudec: trying to gather a 0x%.2x long subtitle"
,
p_spudec
->
i_spu_size
);
p_spudec
->
i_spu_size
);
...
@@ -309,7 +310,22 @@ static void ParsePacket( spudec_thread_t *p_spudec )
...
@@ -309,7 +310,22 @@ static void ParsePacket( spudec_thread_t *p_spudec )
}
}
/* Get RLE data */
/* Get RLE data */
GetChunk
(
&
p_spudec
->
bit_stream
,
p_src
,
p_spudec
->
i_rle_size
);
for
(
i_offset
=
0
;
i_offset
+
SPU_CHUNK_SIZE
<
p_spudec
->
i_rle_size
;
i_offset
+=
SPU_CHUNK_SIZE
)
{
GetChunk
(
&
p_spudec
->
bit_stream
,
p_src
+
i_offset
,
SPU_CHUNK_SIZE
);
if
(
p_spudec
->
p_fifo
->
b_die
)
{
free
(
p_src
);
vout_DestroySubPicture
(
p_spudec
->
p_vout
,
p_spu
);
return
;
}
}
GetChunk
(
&
p_spudec
->
bit_stream
,
p_src
+
i_offset
,
p_spudec
->
i_rle_size
-
i_offset
);
#if 0
#if 0
/* Dump the subtitle info */
/* Dump the subtitle info */
...
@@ -317,7 +333,7 @@ static void ParsePacket( spudec_thread_t *p_spudec )
...
@@ -317,7 +333,7 @@ static void ParsePacket( spudec_thread_t *p_spudec )
#endif
#endif
/* Getting the control part */
/* Getting the control part */
if
(
ParseControlSequences
(
p_spudec
,
p_spu
)
)
if
(
p_spudec
->
p_fifo
->
b_die
||
ParseControlSequences
(
p_spudec
,
p_spu
)
)
{
{
/* There was a parse error, delete the subpicture */
/* There was a parse error, delete the subpicture */
free
(
p_src
);
free
(
p_src
);
...
@@ -325,8 +341,6 @@ static void ParsePacket( spudec_thread_t *p_spudec )
...
@@ -325,8 +341,6 @@ static void ParsePacket( spudec_thread_t *p_spudec )
return
;
return
;
}
}
p_spudec
->
i_skipped_top
=
p_spudec
->
i_skipped_bottom
=
0
;
if
(
ParseRLE
(
p_spudec
,
p_spu
,
p_src
)
)
if
(
ParseRLE
(
p_spudec
,
p_spu
,
p_src
)
)
{
{
/* There was a parse error, delete the subpicture */
/* There was a parse error, delete the subpicture */
...
@@ -335,20 +349,6 @@ static void ParsePacket( spudec_thread_t *p_spudec )
...
@@ -335,20 +349,6 @@ static void ParsePacket( spudec_thread_t *p_spudec )
return
;
return
;
}
}
intf_WarnMsg
(
3
,
"spudec: valid subtitle, size: %ix%i, position: %i,%i"
,
p_spu
->
i_width
,
p_spu
->
i_height
,
p_spu
->
i_x
,
p_spu
->
i_y
);
/* Crop if necessary */
if
(
p_spudec
->
i_skipped_top
||
p_spudec
->
i_skipped_bottom
)
{
p_spu
->
i_y
+=
p_spudec
->
i_skipped_top
;
p_spu
->
i_height
-=
p_spudec
->
i_skipped_top
+
p_spudec
->
i_skipped_bottom
;
intf_WarnMsg
(
3
,
"spudec: cropped to: %ix%i, position: %i,%i"
,
p_spu
->
i_width
,
p_spu
->
i_height
,
p_spu
->
i_x
,
p_spu
->
i_y
);
}
intf_WarnMsg
(
3
,
"spudec: total size: 0x%x, RLE offsets: 0x%x 0x%x"
,
intf_WarnMsg
(
3
,
"spudec: total size: 0x%x, RLE offsets: 0x%x 0x%x"
,
p_spudec
->
i_spu_size
,
p_spudec
->
i_spu_size
,
p_spu
->
type
.
spu
.
i_offset
[
0
],
p_spu
->
type
.
spu
.
i_offset
[
1
]
);
p_spu
->
type
.
spu
.
i_offset
[
0
],
p_spu
->
type
.
spu
.
i_offset
[
1
]
);
...
@@ -578,9 +578,8 @@ static int ParseRLE( spudec_thread_t *p_spudec,
...
@@ -578,9 +578,8 @@ static int ParseRLE( spudec_thread_t *p_spudec,
boolean_t
b_empty_top
=
1
,
boolean_t
b_empty_top
=
1
,
b_empty_bottom
=
0
;
b_empty_bottom
=
0
;
unsigned
int
i_skipped_top
=
0
,
/* XXX: temporary variables */
i_skipped_bottom
=
0
;
boolean_t
b_padding_bytes
=
0
;
pi_table
[
0
]
=
p_spu
->
type
.
spu
.
i_offset
[
0
]
<<
1
;
pi_table
[
0
]
=
p_spu
->
type
.
spu
.
i_offset
[
0
]
<<
1
;
pi_table
[
1
]
=
p_spu
->
type
.
spu
.
i_offset
[
1
]
<<
1
;
pi_table
[
1
]
=
p_spu
->
type
.
spu
.
i_offset
[
1
]
<<
1
;
...
@@ -633,12 +632,12 @@ static int ParseRLE( spudec_thread_t *p_spudec,
...
@@ -633,12 +632,12 @@ static int ParseRLE( spudec_thread_t *p_spudec,
return
(
1
);
return
(
1
);
}
}
if
(
i_code
==
(
i_width
<<
2
)
)
if
(
i_code
==
(
i_width
<<
2
)
)
/* FIXME: we assume 0 is transp */
{
{
if
(
b_empty_top
)
if
(
b_empty_top
)
{
{
/* This is a blank top line, we skip it */
/* This is a blank top line, we skip it */
p_spudec
->
i_skipped_top
++
;
i_skipped_top
++
;
}
}
else
else
{
{
...
@@ -647,7 +646,7 @@ static int ParseRLE( spudec_thread_t *p_spudec,
...
@@ -647,7 +646,7 @@ static int ParseRLE( spudec_thread_t *p_spudec,
*
p_dest
++
=
i_code
;
*
p_dest
++
=
i_code
;
b_empty_bottom
=
1
;
b_empty_bottom
=
1
;
p_spudec
->
i_skipped_bottom
++
;
i_skipped_bottom
++
;
}
}
}
}
else
else
...
@@ -658,7 +657,7 @@ static int ParseRLE( spudec_thread_t *p_spudec,
...
@@ -658,7 +657,7 @@ static int ParseRLE( spudec_thread_t *p_spudec,
/* Valid code means no blank line */
/* Valid code means no blank line */
b_empty_top
=
0
;
b_empty_top
=
0
;
b_empty_bottom
=
0
;
b_empty_bottom
=
0
;
p_spudec
->
i_skipped_bottom
=
0
;
i_skipped_bottom
=
0
;
}
}
}
}
...
@@ -680,19 +679,34 @@ static int ParseRLE( spudec_thread_t *p_spudec,
...
@@ -680,19 +679,34 @@ static int ParseRLE( spudec_thread_t *p_spudec,
i_id
=
~
i_id
&
0x1
;
i_id
=
~
i_id
&
0x1
;
}
}
/* FIXME: we shouldn't need these padding bytes */
/* We shouldn't get any padding bytes */
if
(
i_y
<
i_height
)
{
intf_ErrMsg
(
"spudec: padding bytes found in RLE sequence"
);
intf_ErrMsg
(
"spudec: send mail to <sam@zoy.org> if you "
"want to help debugging this"
);
/* Skip them just in case */
while
(
i_y
<
i_height
)
while
(
i_y
<
i_height
)
{
{
b_padding_bytes
=
1
;
*
p_dest
++
=
i_width
<<
2
;
*
p_dest
++
=
i_width
<<
2
;
i_y
++
;
i_y
++
;
}
}
if
(
b_padding_bytes
)
return
(
1
);
}
intf_WarnMsg
(
3
,
"spudec: valid subtitle, size: %ix%i, position: %i,%i"
,
p_spu
->
i_width
,
p_spu
->
i_height
,
p_spu
->
i_x
,
p_spu
->
i_y
);
/* Crop if necessary */
if
(
i_skipped_top
||
i_skipped_bottom
)
{
{
intf_ErrMsg
(
"spudec: padding bytes found in RLE sequence"
);
p_spu
->
i_y
+=
i_skipped_top
;
intf_ErrMsg
(
"spudec: send mail to <sam@zoy.org> if you "
p_spu
->
i_height
-=
i_skipped_top
+
i_skipped_bottom
;
"want to help debugging this"
);
intf_WarnMsg
(
3
,
"spudec: cropped to: %ix%i, position: %i,%i"
,
p_spu
->
i_width
,
p_spu
->
i_height
,
p_spu
->
i_x
,
p_spu
->
i_y
);
}
}
return
(
0
);
return
(
0
);
...
...
src/spu_decoder/spu_decoder.h
View file @
4d9ab11d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* spu_decoder.h : sub picture unit decoder thread interface
* spu_decoder.h : sub picture unit decoder thread interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: spu_decoder.h,v 1.
9 2001/05/10 06:47:3
1 sam Exp $
* $Id: spu_decoder.h,v 1.
10 2001/05/11 15:10:0
1 sam Exp $
*
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Authors: Samuel Hocevar <sam@zoy.org>
*
*
...
@@ -51,13 +51,15 @@ typedef struct spudec_thread_s
...
@@ -51,13 +51,15 @@ typedef struct spudec_thread_s
// subpicture_t * p_spu;
// subpicture_t * p_spu;
int
i_spu_size
;
/* size of current SPU packet */
int
i_spu_size
;
/* size of current SPU packet */
int
i_rle_size
;
/* size of the RLE part */
int
i_rle_size
;
/* size of the RLE part */
int
i_skipped_top
;
/* skipped RLE lines */
int
i_skipped_bottom
;
}
spudec_thread_t
;
}
spudec_thread_t
;
/*****************************************************************************
* Amount of bytes we GetChunk() in one go
*****************************************************************************/
#define SPU_CHUNK_SIZE 0x200
/*****************************************************************************
/*****************************************************************************
* SPU commands
* SPU commands
*****************************************************************************/
*****************************************************************************/
...
...
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