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
d0c09302
Commit
d0c09302
authored
Oct 22, 2014
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: Use av_gettime_relative
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
248d8fb6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
avconv.c
avconv.c
+6
-6
No files found.
avconv.c
View file @
d0c09302
...
@@ -876,7 +876,7 @@ static void print_report(int is_last_report, int64_t timer_start)
...
@@ -876,7 +876,7 @@ static void print_report(int is_last_report, int64_t timer_start)
if
(
!
is_last_report
)
{
if
(
!
is_last_report
)
{
int64_t
cur_time
;
int64_t
cur_time
;
/* display the report every 0.5 seconds */
/* display the report every 0.5 seconds */
cur_time
=
av_gettime
();
cur_time
=
av_gettime
_relative
();
if
(
last_time
==
-
1
)
{
if
(
last_time
==
-
1
)
{
last_time
=
cur_time
;
last_time
=
cur_time
;
return
;
return
;
...
@@ -913,7 +913,7 @@ static void print_report(int is_last_report, int64_t timer_start)
...
@@ -913,7 +913,7 @@ static void print_report(int is_last_report, int64_t timer_start)
snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
"q=%2.1f "
,
q
);
snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
"q=%2.1f "
,
q
);
}
}
if
(
!
vid
&&
enc
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
if
(
!
vid
&&
enc
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
float
t
=
(
av_gettime
()
-
timer_start
)
/
1000000
.
0
;
float
t
=
(
av_gettime
_relative
()
-
timer_start
)
/
1000000
.
0
;
frame_number
=
ost
->
frame_number
;
frame_number
=
ost
->
frame_number
;
snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
"frame=%5d fps=%3d q=%3.1f "
,
snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
"frame=%5d fps=%3d q=%3.1f "
,
...
@@ -1673,7 +1673,7 @@ static int transcode_init(void)
...
@@ -1673,7 +1673,7 @@ static int transcode_init(void)
InputFile
*
ifile
=
input_files
[
i
];
InputFile
*
ifile
=
input_files
[
i
];
if
(
ifile
->
rate_emu
)
if
(
ifile
->
rate_emu
)
for
(
j
=
0
;
j
<
ifile
->
nb_streams
;
j
++
)
for
(
j
=
0
;
j
<
ifile
->
nb_streams
;
j
++
)
input_streams
[
j
+
ifile
->
ist_index
]
->
start
=
av_gettime
();
input_streams
[
j
+
ifile
->
ist_index
]
->
start
=
av_gettime
_relative
();
}
}
/* output stream init */
/* output stream init */
...
@@ -2281,7 +2281,7 @@ static int get_input_packet(InputFile *f, AVPacket *pkt)
...
@@ -2281,7 +2281,7 @@ static int get_input_packet(InputFile *f, AVPacket *pkt)
for
(
i
=
0
;
i
<
f
->
nb_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
f
->
nb_streams
;
i
++
)
{
InputStream
*
ist
=
input_streams
[
f
->
ist_index
+
i
];
InputStream
*
ist
=
input_streams
[
f
->
ist_index
+
i
];
int64_t
pts
=
av_rescale
(
ist
->
last_dts
,
1000000
,
AV_TIME_BASE
);
int64_t
pts
=
av_rescale
(
ist
->
last_dts
,
1000000
,
AV_TIME_BASE
);
int64_t
now
=
av_gettime
()
-
ist
->
start
;
int64_t
now
=
av_gettime
_relative
()
-
ist
->
start
;
if
(
pts
>
now
)
if
(
pts
>
now
)
return
AVERROR
(
EAGAIN
);
return
AVERROR
(
EAGAIN
);
}
}
...
@@ -2471,7 +2471,7 @@ static int transcode(void)
...
@@ -2471,7 +2471,7 @@ static int transcode(void)
av_log
(
NULL
,
AV_LOG_INFO
,
"Press ctrl-c to stop encoding
\n
"
);
av_log
(
NULL
,
AV_LOG_INFO
,
"Press ctrl-c to stop encoding
\n
"
);
term_init
();
term_init
();
timer_start
=
av_gettime
();
timer_start
=
av_gettime
_relative
();
#if HAVE_PTHREADS
#if HAVE_PTHREADS
if
((
ret
=
init_input_threads
())
<
0
)
if
((
ret
=
init_input_threads
())
<
0
)
...
@@ -2586,7 +2586,7 @@ static int64_t getutime(void)
...
@@ -2586,7 +2586,7 @@ static int64_t getutime(void)
GetProcessTimes
(
proc
,
&
c
,
&
e
,
&
k
,
&
u
);
GetProcessTimes
(
proc
,
&
c
,
&
e
,
&
k
,
&
u
);
return
((
int64_t
)
u
.
dwHighDateTime
<<
32
|
u
.
dwLowDateTime
)
/
10
;
return
((
int64_t
)
u
.
dwHighDateTime
<<
32
|
u
.
dwLowDateTime
)
/
10
;
#else
#else
return
av_gettime
();
return
av_gettime
_relative
();
#endif
#endif
}
}
...
...
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