Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
59c9e899
Commit
59c9e899
authored
Dec 23, 2009
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: calculate duration only once
parent
62ba2f68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
modules/access/v4l2.c
modules/access/v4l2.c
+4
-3
No files found.
modules/access/v4l2.c
View file @
59c9e899
...
...
@@ -560,6 +560,7 @@ struct demux_sys_t
float
f_fps
;
/* <= 0.0 mean to grab at full rate */
mtime_t
i_video_pts
;
/* only used when f_fps > 0 */
int
i_fourcc
;
mtime_t
i_duration
;
/* frame duration calculation */
es_out_id_t
*
p_es
;
...
...
@@ -669,6 +670,8 @@ static int DemuxOpen( vlc_object_t *p_this )
ParseMRL
(
p_sys
,
p_demux
->
psz_path
,
(
vlc_object_t
*
)
p_demux
);
p_sys
->
i_duration
=
(
mtime_t
)((
double
)
1000000
/
(
double
)
p_sys
->
f_fps
);
#ifdef HAVE_LIBV4L2
if
(
!
config_GetInt
(
p_this
,
CFG_PREFIX
"use-libv4l2"
)
)
{
...
...
@@ -1298,10 +1301,8 @@ static block_t* GrabVideo( demux_t *p_demux )
if
(
p_sys
->
f_fps
>=
0
.
1
&&
p_sys
->
i_video_pts
>
0
)
{
mtime_t
i_dur
=
(
mtime_t
)((
double
)
1000000
/
(
double
)
p_sys
->
f_fps
);
/* Did we wait long enough ? (frame rate reduction) */
if
(
p_sys
->
i_video_pts
+
i_dur
>
mdate
()
)
return
NULL
;
if
(
p_sys
->
i_video_pts
+
p_sys
->
i_duration
>
mdate
()
)
return
NULL
;
}
/* Grab Video Frame */
...
...
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