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
217bdd08
Commit
217bdd08
authored
Dec 20, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/srtdec: reindent after previous commits.
parent
6c26fc77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
srtdec.c
libavformat/srtdec.c
+29
-29
No files found.
libavformat/srtdec.c
View file @
217bdd08
...
...
@@ -139,39 +139,39 @@ static int srt_read_header(AVFormatContext *s)
av_bprint_init
(
&
buf
,
0
,
AV_BPRINT_SIZE_UNLIMITED
);
while
(
!
url_feof
(
s
->
pb
))
{
read_chunk
(
s
->
pb
,
&
buf
);
if
(
buf
.
len
)
{
int64_t
pos
=
avio_tell
(
s
->
pb
);
int64_t
pts
;
int
duration
;
const
char
*
ptr
=
buf
.
str
;
int32_t
x1
=
-
1
,
y1
=
-
1
,
x2
=
-
1
,
y2
=
-
1
;
AVPacket
*
sub
;
pts
=
get_pts
(
&
ptr
,
&
duration
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
if
(
pts
!=
AV_NOPTS_VALUE
)
{
int
len
=
buf
.
len
-
(
ptr
-
buf
.
str
);
sub
=
ff_subtitles_queue_insert
(
&
srt
->
q
,
ptr
,
len
,
0
);
if
(
!
sub
)
{
res
=
AVERROR
(
ENOMEM
);
goto
end
;
}
sub
->
pos
=
pos
;
sub
->
pts
=
pts
;
sub
->
duration
=
duration
;
if
(
x1
!=
-
1
)
{
uint8_t
*
p
=
av_packet_new_side_data
(
sub
,
AV_PKT_DATA_SUBTITLE_POSITION
,
16
);
if
(
p
)
{
AV_WL32
(
p
,
x1
);
AV_WL32
(
p
+
4
,
y1
);
AV_WL32
(
p
+
8
,
x2
);
AV_WL32
(
p
+
12
,
y2
);
read_chunk
(
s
->
pb
,
&
buf
);
if
(
buf
.
len
)
{
int64_t
pos
=
avio_tell
(
s
->
pb
);
int64_t
pts
;
int
duration
;
const
char
*
ptr
=
buf
.
str
;
int32_t
x1
=
-
1
,
y1
=
-
1
,
x2
=
-
1
,
y2
=
-
1
;
AVPacket
*
sub
;
pts
=
get_pts
(
&
ptr
,
&
duration
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
if
(
pts
!=
AV_NOPTS_VALUE
)
{
int
len
=
buf
.
len
-
(
ptr
-
buf
.
str
);
sub
=
ff_subtitles_queue_insert
(
&
srt
->
q
,
ptr
,
len
,
0
);
if
(
!
sub
)
{
res
=
AVERROR
(
ENOMEM
);
goto
end
;
}
sub
->
pos
=
pos
;
sub
->
pts
=
pts
;
sub
->
duration
=
duration
;
if
(
x1
!=
-
1
)
{
uint8_t
*
p
=
av_packet_new_side_data
(
sub
,
AV_PKT_DATA_SUBTITLE_POSITION
,
16
);
if
(
p
)
{
AV_WL32
(
p
,
x1
);
AV_WL32
(
p
+
4
,
y1
);
AV_WL32
(
p
+
8
,
x2
);
AV_WL32
(
p
+
12
,
y2
);
}
}
}
}
}
}
ff_subtitles_queue_finalize
(
&
srt
->
q
);
...
...
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