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
07f6a66b
Commit
07f6a66b
authored
Jun 01, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/webvttdec: factorize identifier and settings side data code.
parent
8f75ba99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
21 deletions
+13
-21
webvttdec.c
libavformat/webvttdec.c
+13
-21
No files found.
libavformat/webvttdec.c
View file @
07f6a66b
...
...
@@ -142,27 +142,19 @@ static int webvtt_read_header(AVFormatContext *s)
sub
->
pts
=
ts_start
;
sub
->
duration
=
ts_end
-
ts_start
;
if
(
identifier_len
)
{
uint8_t
*
buf
=
av_packet_new_side_data
(
sub
,
AV_PKT_DATA_WEBVTT_IDENTIFIER
,
identifier_len
);
if
(
!
buf
)
{
res
=
AVERROR
(
ENOMEM
);
goto
end
;
}
memcpy
(
buf
,
identifier
,
identifier_len
);
}
if
(
settings_len
)
{
uint8_t
*
buf
=
av_packet_new_side_data
(
sub
,
AV_PKT_DATA_WEBVTT_SETTINGS
,
settings_len
);
if
(
!
buf
)
{
res
=
AVERROR
(
ENOMEM
);
goto
end
;
}
memcpy
(
buf
,
settings
,
settings_len
);
}
#define SET_SIDE_DATA(name, type) do { \
if (name##_len) { \
uint8_t *buf = av_packet_new_side_data(sub, type, name##_len); \
if (!buf) { \
res = AVERROR(ENOMEM); \
goto end; \
} \
memcpy(buf, name, name##_len); \
} \
} while (0)
SET_SIDE_DATA
(
identifier
,
AV_PKT_DATA_WEBVTT_IDENTIFIER
);
SET_SIDE_DATA
(
settings
,
AV_PKT_DATA_WEBVTT_SETTINGS
);
}
ff_subtitles_queue_finalize
(
&
webvtt
->
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