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
b9cd3e1a
Commit
b9cd3e1a
authored
Oct 27, 2015
by
Timothy Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
srtenc: Reindent
parent
852c4b3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
30 deletions
+29
-30
srtenc.c
libavformat/srtenc.c
+29
-30
No files found.
libavformat/srtenc.c
View file @
b9cd3e1a
...
...
@@ -60,42 +60,41 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
{
SRTContext
*
srt
=
avf
->
priv_data
;
// TODO: reindent
int64_t
s
=
pkt
->
pts
,
e
,
d
=
pkt
->
duration
;
int
size
,
x1
=
-
1
,
y1
=
-
1
,
x2
=
-
1
,
y2
=
-
1
;
const
uint8_t
*
p
;
int64_t
s
=
pkt
->
pts
,
e
,
d
=
pkt
->
duration
;
int
size
,
x1
=
-
1
,
y1
=
-
1
,
x2
=
-
1
,
y2
=
-
1
;
const
uint8_t
*
p
;
p
=
av_packet_get_side_data
(
pkt
,
AV_PKT_DATA_SUBTITLE_POSITION
,
&
size
);
if
(
p
&&
size
==
16
)
{
x1
=
AV_RL32
(
p
);
y1
=
AV_RL32
(
p
+
4
);
x2
=
AV_RL32
(
p
+
8
);
y2
=
AV_RL32
(
p
+
12
);
}
p
=
av_packet_get_side_data
(
pkt
,
AV_PKT_DATA_SUBTITLE_POSITION
,
&
size
);
if
(
p
&&
size
==
16
)
{
x1
=
AV_RL32
(
p
);
y1
=
AV_RL32
(
p
+
4
);
x2
=
AV_RL32
(
p
+
8
);
y2
=
AV_RL32
(
p
+
12
);
}
#if FF_API_CONVERGENCE_DURATION
FF_DISABLE_DEPRECATION_WARNINGS
if
(
d
<=
0
)
/* For backward compatibility, fallback to convergence_duration. */
d
=
pkt
->
convergence_duration
;
if
(
d
<=
0
)
/* For backward compatibility, fallback to convergence_duration. */
d
=
pkt
->
convergence_duration
;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
if
(
s
==
AV_NOPTS_VALUE
||
d
<
0
)
{
av_log
(
avf
,
AV_LOG_WARNING
,
"Insufficient timestamps in event number %d.
\n
"
,
srt
->
index
);
return
0
;
}
e
=
s
+
d
;
avio_printf
(
avf
->
pb
,
"%d
\n
%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d"
,
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
));
if
(
p
)
avio_printf
(
avf
->
pb
,
" X1:%03d X2:%03d Y1:%03d Y2:%03d"
,
x1
,
x2
,
y1
,
y2
);
avio_printf
(
avf
->
pb
,
"
\n
"
);
if
(
s
==
AV_NOPTS_VALUE
||
d
<
0
)
{
av_log
(
avf
,
AV_LOG_WARNING
,
"Insufficient timestamps in event number %d.
\n
"
,
srt
->
index
);
return
0
;
}
e
=
s
+
d
;
avio_printf
(
avf
->
pb
,
"%d
\n
%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d"
,
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
));
if
(
p
)
avio_printf
(
avf
->
pb
,
" X1:%03d X2:%03d Y1:%03d Y2:%03d"
,
x1
,
x2
,
y1
,
y2
);
avio_printf
(
avf
->
pb
,
"
\n
"
);
avio_write
(
avf
->
pb
,
pkt
->
data
,
pkt
->
size
);
avio_write
(
avf
->
pb
,
"
\n\n
"
,
2
);
...
...
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