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
b5451d88
Commit
b5451d88
authored
Feb 26, 2016
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: reindent a few decoders after previous commits
parent
22ebbda6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
51 deletions
+48
-51
movtextenc.c
libavcodec/movtextenc.c
+3
-4
srtenc.c
libavcodec/srtenc.c
+5
-6
assenc.c
libavformat/assenc.c
+40
-41
No files found.
libavcodec/movtextenc.c
View file @
b5451d88
...
@@ -343,10 +343,9 @@ static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf,
...
@@ -343,10 +343,9 @@ static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf,
if
(
!
strncmp
(
ass
,
"Dialogue: "
,
10
))
{
if
(
!
strncmp
(
ass
,
"Dialogue: "
,
10
))
{
int
num
;
int
num
;
dialog
=
ff_ass_split_dialog
(
s
->
ass_ctx
,
ass
,
0
,
&
num
);
dialog
=
ff_ass_split_dialog
(
s
->
ass_ctx
,
ass
,
0
,
&
num
);
// TODO reindent
for
(;
dialog
&&
num
--
;
dialog
++
)
{
for
(;
dialog
&&
num
--
;
dialog
++
)
{
ff_ass_split_override_codes
(
&
mov_text_callbacks
,
s
,
dialog
->
text
);
ff_ass_split_override_codes
(
&
mov_text_callbacks
,
s
,
dialog
->
text
);
}
}
}
else
{
}
else
{
#endif
#endif
dialog
=
ff_ass_split_dialog2
(
s
->
ass_ctx
,
ass
);
dialog
=
ff_ass_split_dialog2
(
s
->
ass_ctx
,
ass
);
...
...
libavcodec/srtenc.c
View file @
b5451d88
...
@@ -248,12 +248,11 @@ static int encode_frame(AVCodecContext *avctx,
...
@@ -248,12 +248,11 @@ static int encode_frame(AVCodecContext *avctx,
if
(
!
strncmp
(
ass
,
"Dialogue: "
,
10
))
{
if
(
!
strncmp
(
ass
,
"Dialogue: "
,
10
))
{
int
num
;
int
num
;
dialog
=
ff_ass_split_dialog
(
s
->
ass_ctx
,
ass
,
0
,
&
num
);
dialog
=
ff_ass_split_dialog
(
s
->
ass_ctx
,
ass
,
0
,
&
num
);
// TODO reindent
for
(;
dialog
&&
num
--
;
dialog
++
)
{
for
(;
dialog
&&
num
--
;
dialog
++
)
{
s
->
alignment_applied
=
0
;
s
->
alignment_applied
=
0
;
srt_style_apply
(
s
,
dialog
->
style
);
srt_style_apply
(
s
,
dialog
->
style
);
ff_ass_split_override_codes
(
cb
,
s
,
dialog
->
text
);
ff_ass_split_override_codes
(
cb
,
s
,
dialog
->
text
);
}
}
}
else
{
}
else
{
#endif
#endif
dialog
=
ff_ass_split_dialog2
(
s
->
ass_ctx
,
ass
);
dialog
=
ff_ass_split_dialog2
(
s
->
ass_ctx
,
ass
);
...
...
libavformat/assenc.c
View file @
b5451d88
...
@@ -156,47 +156,46 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -156,47 +156,46 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
{
{
ASSContext
*
ass
=
s
->
priv_data
;
ASSContext
*
ass
=
s
->
priv_data
;
// TODO: reindent
long
int
layer
;
long
int
layer
;
char
*
p
=
pkt
->
data
;
char
*
p
=
pkt
->
data
;
int64_t
start
=
pkt
->
pts
;
int64_t
start
=
pkt
->
pts
;
int64_t
end
=
start
+
pkt
->
duration
;
int64_t
end
=
start
+
pkt
->
duration
;
int
hh1
,
mm1
,
ss1
,
ms1
;
int
hh1
,
mm1
,
ss1
,
ms1
;
int
hh2
,
mm2
,
ss2
,
ms2
;
int
hh2
,
mm2
,
ss2
,
ms2
;
DialogueLine
*
dialogue
=
av_mallocz
(
sizeof
(
*
dialogue
));
DialogueLine
*
dialogue
=
av_mallocz
(
sizeof
(
*
dialogue
));
if
(
!
dialogue
)
if
(
!
dialogue
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
dialogue
->
readorder
=
strtol
(
p
,
&
p
,
10
);
dialogue
->
readorder
=
strtol
(
p
,
&
p
,
10
);
if
(
dialogue
->
readorder
<
ass
->
expected_readorder
)
if
(
dialogue
->
readorder
<
ass
->
expected_readorder
)
av_log
(
s
,
AV_LOG_WARNING
,
"Unexpected ReadOrder %d
\n
"
,
av_log
(
s
,
AV_LOG_WARNING
,
"Unexpected ReadOrder %d
\n
"
,
dialogue
->
readorder
);
dialogue
->
readorder
);
if
(
*
p
==
','
)
if
(
*
p
==
','
)
p
++
;
p
++
;
if
(
ass
->
ssa_mode
&&
!
strncmp
(
p
,
"Marked="
,
7
))
if
(
ass
->
ssa_mode
&&
!
strncmp
(
p
,
"Marked="
,
7
))
p
+=
7
;
p
+=
7
;
layer
=
strtol
(
p
,
&
p
,
10
);
layer
=
strtol
(
p
,
&
p
,
10
);
if
(
*
p
==
','
)
if
(
*
p
==
','
)
p
++
;
p
++
;
hh1
=
(
int
)(
start
/
360000
);
mm1
=
(
int
)(
start
/
6000
)
%
60
;
hh1
=
(
int
)(
start
/
360000
);
mm1
=
(
int
)(
start
/
6000
)
%
60
;
hh2
=
(
int
)(
end
/
360000
);
mm2
=
(
int
)(
end
/
6000
)
%
60
;
hh2
=
(
int
)(
end
/
360000
);
mm2
=
(
int
)(
end
/
6000
)
%
60
;
ss1
=
(
int
)(
start
/
100
)
%
60
;
ms1
=
(
int
)(
start
%
100
);
ss1
=
(
int
)(
start
/
100
)
%
60
;
ms1
=
(
int
)(
start
%
100
);
ss2
=
(
int
)(
end
/
100
)
%
60
;
ms2
=
(
int
)(
end
%
100
);
ss2
=
(
int
)(
end
/
100
)
%
60
;
ms2
=
(
int
)(
end
%
100
);
if
(
hh1
>
9
)
hh1
=
9
,
mm1
=
59
,
ss1
=
59
,
ms1
=
99
;
if
(
hh1
>
9
)
hh1
=
9
,
mm1
=
59
,
ss1
=
59
,
ms1
=
99
;
if
(
hh2
>
9
)
hh2
=
9
,
mm2
=
59
,
ss2
=
59
,
ms2
=
99
;
if
(
hh2
>
9
)
hh2
=
9
,
mm2
=
59
,
ss2
=
59
,
ms2
=
99
;
dialogue
->
line
=
av_asprintf
(
"%s%ld,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s"
,
dialogue
->
line
=
av_asprintf
(
"%s%ld,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s"
,
ass
->
ssa_mode
?
"Marked="
:
""
,
ass
->
ssa_mode
?
"Marked="
:
""
,
layer
,
hh1
,
mm1
,
ss1
,
ms1
,
hh2
,
mm2
,
ss2
,
ms2
,
p
);
layer
,
hh1
,
mm1
,
ss1
,
ms1
,
hh2
,
mm2
,
ss2
,
ms2
,
p
);
if
(
!
dialogue
->
line
)
{
if
(
!
dialogue
->
line
)
{
av_free
(
dialogue
);
av_free
(
dialogue
);
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
insert_dialogue
(
ass
,
dialogue
);
insert_dialogue
(
ass
,
dialogue
);
purge_dialogues
(
s
,
ass
->
ignore_readorder
);
purge_dialogues
(
s
,
ass
->
ignore_readorder
);
return
0
;
return
0
;
}
}
...
...
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