Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
ffworker
Commits
376edfcf
Commit
376edfcf
authored
Nov 02, 2017
by
Julian Rother
Browse files
remux: Replaced chapter_time_base
parent
b6ebc494
Changes
1
Show whitespace changes
Inline
Side-by-side
remux.c
View file @
376edfcf
...
...
@@ -4,7 +4,7 @@
#include
"util.h"
#include
"config.h"
static
AVRational
chapter_time_base
=
{
1
,
1
}
;
#define CHAPTER_TIME_BASE (AVRational)
{1, 1}
void
parse_dict
(
AVDictionary
**
d
,
char
*
s
)
{
...
...
@@ -30,7 +30,7 @@ void parse_chapters(AVFormatContext *ctx, char *s, int duration)
ctx
->
chapters
[
i
]
=
malloc
(
sizeof
(
AVChapter
));
memset
(
ctx
->
chapters
[
i
],
0
,
sizeof
(
AVChapter
));
ctx
->
chapters
[
i
]
->
id
=
i
;
ctx
->
chapters
[
i
]
->
time_base
=
chapter_time_base
;
ctx
->
chapters
[
i
]
->
time_base
=
CHAPTER_TIME_BASE
;
ctx
->
chapters
[
i
]
->
start
=
jint
(
jlookup
(
p
,
"time"
),
0
);
av_dict_set
(
&
ctx
->
chapters
[
i
]
->
metadata
,
"title"
,
jstr
(
jlookup
(
p
,
"text"
),
"EMPTY"
),
0
);
if
(
i
)
...
...
@@ -67,7 +67,8 @@ int main(int argc, char *argv[])
avformat_alloc_output_context2
(
&
mux
,
0
,
jstr
(
jlookup
(
argv
[
4
],
"format"
),
0
),
path
);
av_dict_copy
(
&
mux
->
metadata
,
demux
->
metadata
,
0
);
parse_dict
(
&
mux
->
metadata
,
jlookup
(
argv
[
4
],
"metadata"
));
parse_chapters
(
mux
,
jlookup
(
argv
[
4
],
"chapters"
),
av_rescale_q
(
demux
->
duration
,
AV_TIME_BASE_Q
,
chapter_time_base
));
parse_chapters
(
mux
,
jlookup
(
argv
[
4
],
"chapters"
),
av_rescale_q
(
demux
->
duration
,
AV_TIME_BASE_Q
,
CHAPTER_TIME_BASE
));
idxmap
=
malloc
(
sizeof
(
int
)
*
demux
->
nb_streams
);
for
(
i
=
0
;
i
<
demux
->
nb_streams
;
i
++
)
{
...
...
Write
Preview
Supports
Markdown
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