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
23eae026
Commit
23eae026
authored
Dec 03, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed INPUT_GET_VIDEO_FPS thread safety.
parent
f6803fd0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
src/input/control.c
src/input/control.c
+2
-6
src/input/input.c
src/input/input.c
+4
-5
src/input/input_internal.h
src/input/input_internal.h
+4
-2
No files found.
src/input/control.c
View file @
23eae026
...
@@ -409,16 +409,12 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
...
@@ -409,16 +409,12 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
}
}
case
INPUT_GET_VIDEO_FPS
:
case
INPUT_GET_VIDEO_FPS
:
{
int
i
;
pf
=
(
double
*
)
va_arg
(
args
,
double
*
);
pf
=
(
double
*
)
va_arg
(
args
,
double
*
);
vlc_mutex_lock
(
&
p_input
->
p
->
p_item
->
lock
);
vlc_mutex_lock
(
&
p_input
->
p
->
p_item
->
lock
);
*
pf
=
p_input
->
p
->
input
.
f_fps
;
*
pf
=
p_input
->
p
->
f_fps
;
for
(
i
=
0
;
i
<
p_input
->
p
->
i_slave
&&
*
pf
<=
0
.
001
;
i
++
)
*
pf
=
p_input
->
p
->
slave
[
i
]
->
f_fps
;
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
case
INPUT_ADD_SLAVE
:
case
INPUT_ADD_SLAVE
:
psz
=
(
char
*
)
va_arg
(
args
,
char
*
);
psz
=
(
char
*
)
va_arg
(
args
,
char
*
);
...
...
src/input/input.c
View file @
23eae026
...
@@ -1006,9 +1006,8 @@ static void LoadSubtitles( input_thread_t *p_input )
...
@@ -1006,9 +1006,8 @@ static void LoadSubtitles( input_thread_t *p_input )
{
{
/* Load subtitles */
/* Load subtitles */
/* Get fps and set it if not already set */
/* Get fps and set it if not already set */
double
f_fps
;
const
double
f_fps
=
p_input
->
p
->
f_fps
;
if
(
!
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_GET_FPS
,
&
f_fps
)
&&
if
(
f_fps
>
1
.
0
)
f_fps
>
1
.
0
)
{
{
float
f_requested_fps
;
float
f_requested_fps
;
...
@@ -2587,10 +2586,10 @@ static int InputSourceInit( input_thread_t *p_input,
...
@@ -2587,10 +2586,10 @@ static int InputSourceInit( input_thread_t *p_input,
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
}
}
}
}
if
(
!
demux_Control
(
in
->
p_demux
,
DEMUX_GET_FPS
,
&
f_fps
)
)
if
(
!
demux_Control
(
in
->
p_demux
,
DEMUX_GET_FPS
,
&
f_fps
)
&&
f_fps
>
0
.
0
)
{
{
vlc_mutex_lock
(
&
p_input
->
p
->
p_item
->
lock
);
vlc_mutex_lock
(
&
p_input
->
p
->
p_item
->
lock
);
in
->
f_fps
=
f_fps
;
p_input
->
p
->
f_fps
=
f_fps
;
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
}
}
...
...
src/input/input_internal.h
View file @
23eae026
...
@@ -69,7 +69,6 @@ typedef struct
...
@@ -69,7 +69,6 @@ typedef struct
bool
b_rescale_ts
;
bool
b_rescale_ts
;
bool
b_eof
;
/* eof of demuxer */
bool
b_eof
;
/* eof of demuxer */
double
f_fps
;
}
input_source_t
;
}
input_source_t
;
...
@@ -82,10 +81,13 @@ struct input_thread_private_t
...
@@ -82,10 +81,13 @@ struct input_thread_private_t
/* Global properties */
/* Global properties */
bool
b_can_pause
;
bool
b_can_pause
;
bool
b_can_rate_control
;
bool
b_can_rate_control
;
double
f_fps
;
/* Current state */
int
i_rate
;
int
i_rate
;
bool
b_recording
;
bool
b_recording
;
/* */
/* Playtime configuration */
int64_t
i_start
;
/* :start-time,0 by default */
int64_t
i_start
;
/* :start-time,0 by default */
int64_t
i_stop
;
/* :stop-time, 0 if none */
int64_t
i_stop
;
/* :stop-time, 0 if none */
int64_t
i_run
;
/* :run-time, 0 if none */
int64_t
i_run
;
/* :run-time, 0 if none */
...
...
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