Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
46acf499
Commit
46acf499
authored
Jan 31, 2000
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
. initialisation du d�codeur de sous-titres
. correction du bug de quit
parent
d8f0cef9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
6 deletions
+36
-6
include/spu_decoder.h
include/spu_decoder.h
+1
-0
src/input/input.c
src/input/input.c
+0
-2
src/input/input_ctrl.c
src/input/input_ctrl.c
+1
-1
src/spu_decoder/spu_decoder.c
src/spu_decoder/spu_decoder.c
+34
-3
No files found.
include/spu_decoder.h
View file @
46acf499
...
...
@@ -37,3 +37,4 @@ typedef struct spudec_thread_s
******************************************************************************/
spudec_thread_t
*
spudec_CreateThread
(
input_thread_t
*
p_input
);
void
spudec_DestroyThread
(
spudec_thread_t
*
p_spudec
);
src/input/input.c
View file @
46acf499
...
...
@@ -414,7 +414,6 @@ static void EndThread( input_thread_t * p_input )
ac3dec_DestroyThread
(
(
ac3dec_thread_t
*
)(
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_dec
)
);
break
;
case
DVD_SPU_ES
:
fprintf
(
stderr
,
"input.h : destroying spudec
\n
"
);
spudec_DestroyThread
(
(
spudec_thread_t
*
)(
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_dec
)
);
break
;
case
0
:
...
...
@@ -1072,7 +1071,6 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
case
DVD_SPU_ES
:
/* we skip 4 bytes at the beginning of the subpicture payload */
p_ts
->
i_payload_start
+=
4
;
fprintf
(
stderr
,
"input.h : launching spudec
\n
"
);
p_fifo
=
&
(((
spudec_thread_t
*
)(
p_es_descriptor
->
p_dec
))
->
fifo
);
break
;
...
...
src/input/input_ctrl.c
View file @
46acf499
...
...
@@ -117,7 +117,7 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
if
(
((
spudec_thread_t
*
)(
p_input
->
p_es
[
i_es_loop
].
p_dec
)
=
spudec_CreateThread
(
p_input
))
==
NULL
)
{
intf_ErrMsg
(
"Could not start s
ubtitle
decoder
\n
"
);
intf_ErrMsg
(
"Could not start s
pu
decoder
\n
"
);
vlc_mutex_unlock
(
&
p_input
->
es_lock
);
return
(
-
1
);
}
...
...
src/spu_decoder/spu_decoder.c
View file @
46acf499
...
...
@@ -48,7 +48,6 @@ spudec_thread_t * spudec_CreateThread( input_thread_t * p_input )
spudec_thread_t
*
p_spudec
;
intf_DbgMsg
(
"spudec debug: creating spu decoder thread
\n
"
);
fprintf
(
stderr
,
"spudec debug: creating spu decoder thread
\n
"
);
/* Allocate the memory needed to store the thread's structure */
if
(
(
p_spudec
=
(
spudec_thread_t
*
)
malloc
(
sizeof
(
spudec_thread_t
)
))
==
NULL
)
...
...
@@ -63,6 +62,16 @@ spudec_thread_t * spudec_CreateThread( input_thread_t * p_input )
p_spudec
->
b_die
=
0
;
p_spudec
->
b_error
=
0
;
/*
* Initialize the input properties
*/
/* Initialize the decoder fifo's data lock and conditional variable and set
* its buffer as empty */
vlc_mutex_init
(
&
p_spudec
->
fifo
.
data_lock
);
vlc_cond_init
(
&
p_spudec
->
fifo
.
data_wait
);
p_spudec
->
fifo
.
i_start
=
0
;
p_spudec
->
fifo
.
i_end
=
0
;
/* Spawn the spu decoder thread */
if
(
vlc_thread_create
(
&
p_spudec
->
thread_id
,
"spu decoder"
,
(
vlc_thread_func_t
)
RunThread
,
(
void
*
)
p_spudec
)
)
...
...
@@ -91,6 +100,9 @@ void spudec_DestroyThread( spudec_thread_t *p_spudec )
/* Ask thread to kill itself */
p_spudec
->
b_die
=
1
;
/* Warn the decoder that we're quitting */
vlc_cond_signal
(
&
p_spudec
->
fifo
.
data_wait
);
/* Waiting for the decoder thread to exit */
/* Remove this as soon as the "status" flag is implemented */
vlc_thread_join
(
p_spudec
->
thread_id
);
...
...
@@ -107,9 +119,26 @@ void spudec_DestroyThread( spudec_thread_t *p_spudec )
*******************************************************************************/
static
int
InitThread
(
spudec_thread_t
*
p_spudec
)
{
intf_DbgMsg
(
"spudec debug: initializing spu decoder thread %p
\n
"
,
p_spudec
);
/* Our first job is to initialize the bit stream structure with the
* beginning of the input stream */
vlc_mutex_lock
(
&
p_spudec
->
fifo
.
data_lock
);
while
(
DECODER_FIFO_ISEMPTY
(
p_spudec
->
fifo
)
&&
!
p_spudec
->
b_die
)
{
vlc_cond_wait
(
&
p_spudec
->
fifo
.
data_wait
,
&
p_spudec
->
fifo
.
data_lock
);
}
if
(
p_spudec
->
b_die
)
{
vlc_mutex_unlock
(
&
p_spudec
->
fifo
.
data_lock
);
return
(
0
);
}
p_spudec
->
bit_stream
.
p_ts
=
DECODER_FIFO_START
(
p_spudec
->
fifo
)
->
p_first_ts
;
p_spudec
->
bit_stream
.
i_byte
=
p_spudec
->
bit_stream
.
p_ts
->
i_payload_start
;
vlc_mutex_unlock
(
&
p_spudec
->
fifo
.
data_lock
);
/* Mark thread as running and return */
intf_DbgMsg
(
"spudec debug: InitThread(%p) succeeded
\n
"
,
p_spudec
);
return
(
0
);
...
...
@@ -142,7 +171,9 @@ static void RunThread( spudec_thread_t *p_spudec )
*/
while
(
(
!
p_spudec
->
b_die
)
&&
(
!
p_spudec
->
b_error
)
)
{
fprintf
(
stderr
,
"I'm a spu decoder !
\n
"
);
fprintf
(
stderr
,
"I'm in the spu decoder main loop !
\n
"
);
sleep
(
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