Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
d46c9f83
Commit
d46c9f83
authored
Mar 12, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fbdev: simplify logic in fbdev_read_packet()
Signed-off-by:
Stefano Sabatini
<
stefano.sabatini-lala@poste.it
>
parent
df2d5b16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
fbdev.c
libavdevice/fbdev.c
+8
-10
No files found.
libavdevice/fbdev.c
View file @
d46c9f83
...
...
@@ -189,22 +189,20 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
fbdev
->
time_frame
=
av_gettime
();
/* wait based on the frame rate */
while
(
1
)
{
curtime
=
av_gettime
();
delay
=
fbdev
->
time_frame
-
curtime
;
av_dlog
(
avctx
,
"time_frame:%"
PRId64
" curtime:%"
PRId64
" delay:%"
PRId64
"
\n
"
,
fbdev
->
time_frame
,
curtime
,
delay
);
if
(
delay
<=
0
)
{
fbdev
->
time_frame
+=
INT64_C
(
1000000
)
*
av_q2d
(
fbdev
->
time_base
);
break
;
}
curtime
=
av_gettime
();
delay
=
fbdev
->
time_frame
-
curtime
;
av_dlog
(
avctx
,
"time_frame:%"
PRId64
" curtime:%"
PRId64
" delay:%"
PRId64
"
\n
"
,
fbdev
->
time_frame
,
curtime
,
delay
);
if
(
delay
>
0
)
{
if
(
avctx
->
flags
&
AVFMT_FLAG_NONBLOCK
)
return
AVERROR
(
EAGAIN
);
ts
.
tv_sec
=
delay
/
1000000
;
ts
.
tv_nsec
=
(
delay
%
1000000
)
*
1000
;
while
(
nanosleep
(
&
ts
,
&
ts
)
<
0
&&
errno
==
EINTR
);
}
/* compute the time of the next frame */
fbdev
->
time_frame
+=
INT64_C
(
1000000
)
*
av_q2d
(
fbdev
->
time_base
);
if
((
ret
=
av_new_packet
(
pkt
,
fbdev
->
frame_size
))
<
0
)
return
ret
;
...
...
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