Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
6873cf9b
Commit
6873cf9b
authored
Dec 16, 2010
by
Aurelien Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compute rects duration in ASS decoder
Signed-off-by:
Aurelien Jacobs
<
aurel@gnuage.org
>
parent
3ee8ca9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
assdec.c
libavcodec/assdec.c
+13
-1
No files found.
libavcodec/assdec.c
View file @
6873cf9b
...
...
@@ -21,6 +21,7 @@
#include "avcodec.h"
#include "ass.h"
#include "ass_split.h"
static
av_cold
int
ass_decode_init
(
AVCodecContext
*
avctx
)
{
...
...
@@ -29,6 +30,7 @@ static av_cold int ass_decode_init(AVCodecContext *avctx)
return
AVERROR
(
ENOMEM
);
memcpy
(
avctx
->
subtitle_header
,
avctx
->
extradata
,
avctx
->
extradata_size
);
avctx
->
subtitle_header_size
=
avctx
->
extradata_size
;
avctx
->
priv_data
=
ff_ass_split
(
avctx
->
extradata
);
return
0
;
}
...
...
@@ -39,7 +41,9 @@ static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr,
int
len
,
size
=
avpkt
->
size
;
while
(
size
>
0
)
{
len
=
ff_ass_add_rect
(
data
,
ptr
,
0
,
0
/* FIXME: duration */
,
1
);
ASSDialog
*
dialog
=
ff_ass_split_dialog
(
avctx
->
priv_data
,
ptr
,
0
,
NULL
);
int
duration
=
dialog
->
end
-
dialog
->
start
;
len
=
ff_ass_add_rect
(
data
,
ptr
,
0
,
duration
,
1
);
if
(
len
<
0
)
return
len
;
ptr
+=
len
;
...
...
@@ -50,6 +54,13 @@ static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr,
return
avpkt
->
size
;
}
static
int
ass_decode_close
(
AVCodecContext
*
avctx
)
{
ff_ass_split_free
(
avctx
->
priv_data
);
avctx
->
priv_data
=
NULL
;
return
0
;
}
AVCodec
ff_ass_decoder
=
{
.
name
=
"ass"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Advanced SubStation Alpha subtitle"
),
...
...
@@ -57,4 +68,5 @@ AVCodec ff_ass_decoder = {
.
id
=
CODEC_ID_SSA
,
.
init
=
ass_decode_init
,
.
decode
=
ass_decode_frame
,
.
close
=
ass_decode_close
,
};
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