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
fd090a5d
Commit
fd090a5d
authored
Oct 21, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/srtenc: simplify timing printing.
parent
c27b3816
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
srtenc.c
libavformat/srtenc.c
+1
-5
No files found.
libavformat/srtenc.c
View file @
fd090a5d
...
...
@@ -60,9 +60,7 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
srt
->
index
++
;
if
(
write_ts
)
{
char
buf
[
64
];
int64_t
s
=
pkt
->
pts
,
e
,
d
=
pkt
->
duration
;
int
len
;
if
(
d
<=
0
)
/* For backward compatibility, fallback to convergence_duration. */
...
...
@@ -72,14 +70,12 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
return
AVERROR
(
EINVAL
);
}
e
=
s
+
d
;
len
=
snprintf
(
buf
,
sizeof
(
buf
),
"%d
\n
%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d
\n
"
,
avio_printf
(
avf
->
pb
,
"%d
\n
%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d
\n
"
,
srt
->
index
,
(
int
)(
s
/
3600000
),
(
int
)(
s
/
60000
)
%
60
,
(
int
)(
s
/
1000
)
%
60
,
(
int
)(
s
%
1000
),
(
int
)(
e
/
3600000
),
(
int
)(
e
/
60000
)
%
60
,
(
int
)(
e
/
1000
)
%
60
,
(
int
)(
e
%
1000
));
avio_write
(
avf
->
pb
,
buf
,
len
);
}
avio_write
(
avf
->
pb
,
pkt
->
data
,
pkt
->
size
);
if
(
write_ts
)
...
...
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