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
071f4764
Commit
071f4764
authored
Dec 04, 2017
by
Steven Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hlsplaylist: add int type of API ff_hls_write_file_entry
Signed-off-by:
Steven Liu
<
lq@chinaffmpeg.org
>
parent
31b351ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
dashenc.c
libavformat/dashenc.c
+5
-1
hlsenc.c
libavformat/hlsenc.c
+8
-4
hlsplaylist.c
libavformat/hlsplaylist.c
+4
-2
hlsplaylist.h
libavformat/hlsplaylist.h
+1
-1
No files found.
libavformat/dashenc.c
View file @
071f4764
...
...
@@ -342,6 +342,7 @@ static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext
AVIOContext
*
out_hls
=
NULL
;
AVDictionary
*
http_opts
=
NULL
;
int
target_duration
=
0
;
int
ret
=
0
;
const
char
*
proto
=
avio_find_protocol_name
(
c
->
dirname
);
int
use_rename
=
proto
&&
!
strcmp
(
proto
,
"file"
);
...
...
@@ -368,11 +369,14 @@ static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext
for
(
i
=
start_index
;
i
<
os
->
nb_segments
;
i
++
)
{
Segment
*
seg
=
os
->
segments
[
i
];
ff_hls_write_file_entry
(
out_hls
,
0
,
c
->
single_file
,
ret
=
ff_hls_write_file_entry
(
out_hls
,
0
,
c
->
single_file
,
(
double
)
seg
->
duration
/
timescale
,
0
,
seg
->
range_length
,
seg
->
start_pos
,
NULL
,
c
->
single_file
?
os
->
initfile
:
seg
->
file
,
NULL
);
if
(
ret
<
0
)
{
av_log
(
os
->
ctx
,
AV_LOG_WARNING
,
"ff_hls_write_file_entry get error
\n
"
);
}
}
if
(
final
)
...
...
libavformat/hlsenc.c
View file @
071f4764
...
...
@@ -1236,11 +1236,13 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
hls
->
flags
&
HLS_SINGLE_FILE
,
en
->
size
,
en
->
pos
);
}
ff_hls_write_file_entry
(
out
,
en
->
discont
,
byterange_mode
,
ret
=
ff_hls_write_file_entry
(
out
,
en
->
discont
,
byterange_mode
,
en
->
duration
,
hls
->
flags
&
HLS_ROUND_DURATIONS
,
en
->
size
,
en
->
pos
,
vs
->
baseurl
,
en
->
filename
,
prog_date_time_p
);
if
(
ret
<
0
)
{
av_log
(
s
,
AV_LOG_WARNING
,
"ff_hls_write_file_entry get error
\n
"
);
}
}
if
(
last
&&
(
hls
->
flags
&
HLS_OMIT_ENDLIST
)
==
0
)
...
...
@@ -1251,11 +1253,13 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
goto
fail
;
ff_hls_write_playlist_header
(
sub_out
,
hls
->
version
,
hls
->
allowcache
,
target_duration
,
sequence
,
PLAYLIST_TYPE_NONE
);
for
(
en
=
vs
->
segments
;
en
;
en
=
en
->
next
)
{
ff_hls_write_file_entry
(
sub_out
,
0
,
byterange_mode
,
ret
=
ff_hls_write_file_entry
(
sub_out
,
0
,
byterange_mode
,
en
->
duration
,
0
,
en
->
size
,
en
->
pos
,
vs
->
baseurl
,
en
->
sub_filename
,
NULL
);
if
(
ret
<
0
)
{
av_log
(
s
,
AV_LOG_WARNING
,
"ff_hls_write_file_entry get error
\n
"
);
}
}
if
(
last
)
...
...
libavformat/hlsplaylist.c
View file @
071f4764
...
...
@@ -82,14 +82,14 @@ void ff_hls_write_init_file(AVIOContext *out, char *filename,
avio_printf
(
out
,
"
\n
"
);
}
void
ff_hls_write_file_entry
(
AVIOContext
*
out
,
int
insert_discont
,
int
ff_hls_write_file_entry
(
AVIOContext
*
out
,
int
insert_discont
,
int
byterange_mode
,
double
duration
,
int
round_duration
,
int64_t
size
,
int64_t
pos
,
//Used only if HLS_SINGLE_FILE flag is set
char
*
baseurl
,
//Ignored if NULL
char
*
filename
,
double
*
prog_date_time
)
{
if
(
!
out
||
!
filename
)
return
;
return
AVERROR
(
EINVAL
)
;
if
(
insert_discont
)
{
avio_printf
(
out
,
"#EXT-X-DISCONTINUITY
\n
"
);
...
...
@@ -128,6 +128,8 @@ void ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
if
(
baseurl
)
avio_printf
(
out
,
"%s"
,
baseurl
);
avio_printf
(
out
,
"%s
\n
"
,
filename
);
return
0
;
}
void
ff_hls_write_end_list
(
AVIOContext
*
out
)
{
...
...
libavformat/hlsplaylist.h
View file @
071f4764
...
...
@@ -49,7 +49,7 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
uint32_t
playlist_type
);
void
ff_hls_write_init_file
(
AVIOContext
*
out
,
char
*
filename
,
int
byterange_mode
,
int64_t
size
,
int64_t
pos
);
void
ff_hls_write_file_entry
(
AVIOContext
*
out
,
int
insert_discont
,
int
ff_hls_write_file_entry
(
AVIOContext
*
out
,
int
insert_discont
,
int
byterange_mode
,
double
duration
,
int
round_duration
,
int64_t
size
,
int64_t
pos
,
//Used only if HLS_SINGLE_FILE flag is set
...
...
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