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
c5e7ea13
Commit
c5e7ea13
authored
Nov 03, 2014
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashenc: Use delay_moov
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
b3b0b35d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
dashenc.c
libavformat/dashenc.c
+14
-9
No files found.
libavformat/dashenc.c
View file @
c5e7ea13
...
@@ -626,7 +626,7 @@ static int dash_write_header(AVFormatContext *s)
...
@@ -626,7 +626,7 @@ static int dash_write_header(AVFormatContext *s)
goto
fail
;
goto
fail
;
os
->
init_start_pos
=
0
;
os
->
init_start_pos
=
0
;
av_dict_set
(
&
opts
,
"movflags"
,
"frag_custom+dash"
,
0
);
av_dict_set
(
&
opts
,
"movflags"
,
"frag_custom+dash
+delay_moov
"
,
0
);
if
((
ret
=
avformat_write_header
(
ctx
,
&
opts
))
<
0
)
{
if
((
ret
=
avformat_write_header
(
ctx
,
&
opts
))
<
0
)
{
goto
fail
;
goto
fail
;
}
}
...
@@ -634,13 +634,7 @@ static int dash_write_header(AVFormatContext *s)
...
@@ -634,13 +634,7 @@ static int dash_write_header(AVFormatContext *s)
avio_flush
(
ctx
->
pb
);
avio_flush
(
ctx
->
pb
);
av_dict_free
(
&
opts
);
av_dict_free
(
&
opts
);
if
(
c
->
single_file
)
{
av_log
(
s
,
AV_LOG_VERBOSE
,
"Representation %d init segment will be written to: %s
\n
"
,
i
,
filename
);
os
->
init_range_length
=
avio_tell
(
ctx
->
pb
);
}
else
{
ffurl_close
(
os
->
out
);
os
->
out
=
NULL
;
}
av_log
(
s
,
AV_LOG_VERBOSE
,
"Representation %d init segment written to: %s
\n
"
,
i
,
filename
);
s
->
streams
[
i
]
->
time_base
=
st
->
time_base
;
s
->
streams
[
i
]
->
time_base
=
st
->
time_base
;
// If the muxer wants to shift timestamps, request to have them shifted
// If the muxer wants to shift timestamps, request to have them shifted
...
@@ -746,7 +740,7 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
...
@@ -746,7 +740,7 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
OutputStream
*
os
=
&
c
->
streams
[
i
];
OutputStream
*
os
=
&
c
->
streams
[
i
];
char
filename
[
1024
]
=
""
,
full_path
[
1024
],
temp_path
[
1024
];
char
filename
[
1024
]
=
""
,
full_path
[
1024
],
temp_path
[
1024
];
int64_t
start_pos
=
avio_tell
(
os
->
ctx
->
pb
)
;
int64_t
start_pos
;
int
range_length
,
index_length
=
0
;
int
range_length
,
index_length
=
0
;
if
(
!
os
->
packets_written
)
if
(
!
os
->
packets_written
)
...
@@ -764,6 +758,17 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
...
@@ -764,6 +758,17 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
continue
;
continue
;
}
}
if
(
!
os
->
init_range_length
)
{
av_write_frame
(
os
->
ctx
,
NULL
);
os
->
init_range_length
=
avio_tell
(
os
->
ctx
->
pb
);
if
(
!
c
->
single_file
)
{
ffurl_close
(
os
->
out
);
os
->
out
=
NULL
;
}
}
start_pos
=
avio_tell
(
os
->
ctx
->
pb
);
if
(
!
c
->
single_file
)
{
if
(
!
c
->
single_file
)
{
dash_fill_tmpl_params
(
filename
,
sizeof
(
filename
),
c
->
media_seg_name
,
i
,
os
->
segment_index
,
os
->
bit_rate
,
os
->
start_dts
);
dash_fill_tmpl_params
(
filename
,
sizeof
(
filename
),
c
->
media_seg_name
,
i
,
os
->
segment_index
,
os
->
bit_rate
,
os
->
start_dts
);
snprintf
(
full_path
,
sizeof
(
full_path
),
"%s%s"
,
c
->
dirname
,
filename
);
snprintf
(
full_path
,
sizeof
(
full_path
),
"%s%s"
,
c
->
dirname
,
filename
);
...
...
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