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
7e12de50
Commit
7e12de50
authored
Sep 02, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
es: copy va_list only when needed
parent
8beacc9e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
modules/demux/mpeg/es.c
modules/demux/mpeg/es.c
+10
-13
No files found.
modules/demux/mpeg/es.c
View file @
7e12de50
...
@@ -332,28 +332,28 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -332,28 +332,28 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
int64_t
*
pi64
;
int64_t
*
pi64
;
bool
*
pb_bool
;
bool
*
pb_bool
;
int
i_ret
;
int
i_ret
;
va_list
args_save
;
va_copy
(
args_save
,
args
);
switch
(
i_query
)
switch
(
i_query
)
{
{
case
DEMUX_HAS_UNSUPPORTED_META
:
case
DEMUX_HAS_UNSUPPORTED_META
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
true
;
*
pb_bool
=
true
;
va_end
(
args_save
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
case
DEMUX_GET_TIME
:
case
DEMUX_GET_TIME
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
p_sys
->
i_pts
+
p_sys
->
i_time_offset
;
*
pi64
=
p_sys
->
i_pts
+
p_sys
->
i_time_offset
;
va_end
(
args_save
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
case
DEMUX_GET_LENGTH
:
case
DEMUX_GET_LENGTH
:
i_ret
=
demux_vaControlHelper
(
p_demux
->
s
,
p_sys
->
i_stream_offset
,
-
1
,
{
p_sys
->
i_bitrate_avg
,
1
,
i_query
,
va_list
ap
;
args
);
va_copy
(
ap
,
args
);
i_ret
=
demux_vaControlHelper
(
p_demux
->
s
,
p_sys
->
i_stream_offset
,
-
1
,
p_sys
->
i_bitrate_avg
,
1
,
i_query
,
ap
);
va_end
(
ap
);
/* No bitrate, we can't have it precisely, but we can compute
/* No bitrate, we can't have it precisely, but we can compute
* a raw approximation with time/position */
* a raw approximation with time/position */
if
(
i_ret
&&
!
p_sys
->
i_bitrate_avg
)
if
(
i_ret
&&
!
p_sys
->
i_bitrate_avg
)
...
@@ -365,17 +365,15 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -365,17 +365,15 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if
(
f_pos
<
0
.
01
||
if
(
f_pos
<
0
.
01
||
(
p_sys
->
i_pts
+
p_sys
->
i_time_offset
)
<
8000000
)
(
p_sys
->
i_pts
+
p_sys
->
i_time_offset
)
<
8000000
)
{
{
va_end
(
args_save
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
pi64
=
(
int64_t
*
)
va_arg
(
args
_save
,
int64_t
*
);
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
(
p_sys
->
i_pts
+
p_sys
->
i_time_offset
)
/
f_pos
;
*
pi64
=
(
p_sys
->
i_pts
+
p_sys
->
i_time_offset
)
/
f_pos
;
va_end
(
args_save
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
va_end
(
args_save
);
return
i_ret
;
return
i_ret
;
}
case
DEMUX_SET_TIME
:
case
DEMUX_SET_TIME
:
/* FIXME TODO: implement a high precision seek (with mp3 parsing)
/* FIXME TODO: implement a high precision seek (with mp3 parsing)
...
@@ -384,7 +382,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -384,7 +382,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
i_ret
=
demux_vaControlHelper
(
p_demux
->
s
,
p_sys
->
i_stream_offset
,
-
1
,
i_ret
=
demux_vaControlHelper
(
p_demux
->
s
,
p_sys
->
i_stream_offset
,
-
1
,
p_sys
->
i_bitrate_avg
,
1
,
i_query
,
p_sys
->
i_bitrate_avg
,
1
,
i_query
,
args
);
args
);
va_end
(
args_save
);
if
(
!
i_ret
&&
p_sys
->
i_bitrate_avg
>
0
&&
if
(
!
i_ret
&&
p_sys
->
i_bitrate_avg
>
0
&&
(
i_query
==
DEMUX_SET_POSITION
||
i_query
==
DEMUX_SET_TIME
)
)
(
i_query
==
DEMUX_SET_POSITION
||
i_query
==
DEMUX_SET_TIME
)
)
{
{
...
...
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