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
48029873
Commit
48029873
authored
Nov 26, 2010
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlm: make proper use of semaphore
parent
ca29b79f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
14 deletions
+18
-14
include/vlc_sout.h
include/vlc_sout.h
+0
-1
modules/stream_out/description.c
modules/stream_out/description.c
+0
-3
src/input/vlm.c
src/input/vlm.c
+18
-10
No files found.
include/vlc_sout.h
View file @
48029873
...
...
@@ -273,7 +273,6 @@ typedef struct sout_description_data_t
int
i_es
;
es_format_t
**
es
;
vlc_sem_t
*
sem
;
bool
stop
;
}
sout_description_data_t
;
#ifdef __cplusplus
...
...
modules/stream_out/description.c
View file @
48029873
...
...
@@ -143,10 +143,7 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
block_ChainRelease
(
p_buffer
);
if
(
p_sys
->
i_stream_start
+
1500000
<
mdate
()
)
{
p_sys
->
data
->
stop
=
true
;
vlc_sem_post
(
p_sys
->
data
->
sem
);
}
return
VLC_SUCCESS
;
}
src/input/vlm.c
View file @
48029873
...
...
@@ -70,15 +70,21 @@ static void vlm_Destructor( vlm_t *p_vlm );
static
void
*
Manage
(
void
*
);
static
int
vlm_MediaVodControl
(
void
*
,
vod_media_t
*
,
const
char
*
,
int
,
va_list
);
typedef
struct
preparse_data_t
{
vlc_sem_t
*
p_sem
;
bool
b_mux
;
}
preparse_data_t
;
static
int
InputEventPreparse
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
psz_cmd
);
VLC_UNUSED
(
oldval
);
vlc_sem_t
*
p_sem_prepars
e
=
p_data
;
preparse_data_t
*
p_pr
e
=
p_data
;
if
(
newval
.
i_int
==
INPUT_EVENT_DEAD
||
newval
.
i_int
==
INPUT_EVENT_ITEM_META
)
vlc_sem_post
(
p_
sem_preparse
);
(
p_pre
->
b_mux
&&
newval
.
i_int
==
INPUT_EVENT_ITEM_META
)
)
vlc_sem_post
(
p_
pre
->
p_sem
);
return
VLC_SUCCESS
;
}
...
...
@@ -623,19 +629,21 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
{
vlc_sem_t
sem_preparse
;
vlc_sem_init
(
&
sem_preparse
,
0
);
var_AddCallback
(
p_input
,
"intf-event"
,
InputEventPreparse
,
&
sem_preparse
);
data
.
stop
=
false
;
preparse_data_t
preparse
=
{
.
p_sem
=
&
sem_preparse
,
.
b_mux
=
(
p_cfg
->
vod
.
psz_mux
!=
NULL
)
};
var_AddCallback
(
p_input
,
"intf-event"
,
InputEventPreparse
,
&
preparse
);
data
.
sem
=
&
sem_preparse
;
var_Create
(
p_input
,
"sout-description-data"
,
VLC_VAR_ADDRESS
);
var_SetAddress
(
p_input
,
"sout-description-data"
,
&
data
);
if
(
!
input_Start
(
p_input
)
)
{
while
(
!
data
.
stop
&&
!
p_input
->
b_dead
&&
(
!
p_cfg
->
vod
.
psz_mux
||
!
input_item_IsPreparsed
(
p_media
->
vod
.
p_item
)
)
)
vlc_sem_wait
(
&
sem_preparse
);
}
vlc_sem_wait
(
&
sem_preparse
);
var_DelCallback
(
p_input
,
"intf-event"
,
InputEventPreparse
,
&
sem_preparse
);
var_DelCallback
(
p_input
,
"intf-event"
,
InputEventPreparse
,
&
preparse
);
input_Stop
(
p_input
,
true
);
vlc_thread_join
(
p_input
);
...
...
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