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
6c70f898
Commit
6c70f898
authored
May 25, 2020
by
Andreas Rheinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hlsenc, hlsplaylist: Cosmetics
Signed-off-by:
Andreas Rheinhardt
<
andreas.rheinhardt@gmail.com
>
parent
4fbcb697
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
15 deletions
+21
-15
hlsenc.c
libavformat/hlsenc.c
+2
-3
hlsplaylist.c
libavformat/hlsplaylist.c
+14
-8
hlsplaylist.h
libavformat/hlsplaylist.h
+5
-4
No files found.
libavformat/hlsenc.c
View file @
6c70f898
...
@@ -2137,9 +2137,8 @@ static int update_variant_stream_info(AVFormatContext *s)
...
@@ -2137,9 +2137,8 @@ static int update_variant_stream_info(AVFormatContext *s)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
//by default, the first available ccgroup is mapped to the variant stream
//by default, the first available ccgroup is mapped to the variant stream
if
(
hls
->
nb_ccstreams
)
{
if
(
hls
->
nb_ccstreams
)
hls
->
var_streams
[
0
].
ccgroup
=
hls
->
cc_streams
[
0
].
ccgroup
;
hls
->
var_streams
[
0
].
ccgroup
=
hls
->
cc_streams
[
0
].
ccgroup
;
}
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
hls
->
var_streams
[
0
].
streams
[
i
]
=
s
->
streams
[
i
];
hls
->
var_streams
[
0
].
streams
[
i
]
=
s
->
streams
[
i
];
...
@@ -2320,7 +2319,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -2320,7 +2319,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
vs
->
start_pts_from_audio
=
0
;
vs
->
start_pts_from_audio
=
0
;
}
}
if
(
vs
->
has_video
)
{
if
(
vs
->
has_video
)
{
can_split
=
st
->
codecpar
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
can_split
=
st
->
codecpar
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
((
pkt
->
flags
&
AV_PKT_FLAG_KEY
)
||
(
hls
->
flags
&
HLS_SPLIT_BY_TIME
));
((
pkt
->
flags
&
AV_PKT_FLAG_KEY
)
||
(
hls
->
flags
&
HLS_SPLIT_BY_TIME
));
is_ref_pkt
=
(
st
->
codecpar
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
&&
(
pkt
->
stream_index
==
vs
->
reference_stream_index
);
is_ref_pkt
=
(
st
->
codecpar
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
&&
(
pkt
->
stream_index
==
vs
->
reference_stream_index
);
...
...
libavformat/hlsplaylist.c
View file @
6c70f898
...
@@ -28,7 +28,8 @@
...
@@ -28,7 +28,8 @@
#include "avformat.h"
#include "avformat.h"
#include "hlsplaylist.h"
#include "hlsplaylist.h"
void
ff_hls_write_playlist_version
(
AVIOContext
*
out
,
int
version
)
{
void
ff_hls_write_playlist_version
(
AVIOContext
*
out
,
int
version
)
{
if
(
!
out
)
if
(
!
out
)
return
;
return
;
avio_printf
(
out
,
"#EXTM3U
\n
"
);
avio_printf
(
out
,
"#EXTM3U
\n
"
);
...
@@ -96,7 +97,8 @@ void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth,
...
@@ -96,7 +97,8 @@ void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth,
void
ff_hls_write_playlist_header
(
AVIOContext
*
out
,
int
version
,
int
allowcache
,
void
ff_hls_write_playlist_header
(
AVIOContext
*
out
,
int
version
,
int
allowcache
,
int
target_duration
,
int64_t
sequence
,
int
target_duration
,
int64_t
sequence
,
uint32_t
playlist_type
,
int
iframe_mode
)
{
uint32_t
playlist_type
,
int
iframe_mode
)
{
if
(
!
out
)
if
(
!
out
)
return
;
return
;
ff_hls_write_playlist_version
(
out
,
version
);
ff_hls_write_playlist_version
(
out
,
version
);
...
@@ -118,7 +120,8 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
...
@@ -118,7 +120,8 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
}
}
void
ff_hls_write_init_file
(
AVIOContext
*
out
,
const
char
*
filename
,
void
ff_hls_write_init_file
(
AVIOContext
*
out
,
const
char
*
filename
,
int
byterange_mode
,
int64_t
size
,
int64_t
pos
)
{
int
byterange_mode
,
int64_t
size
,
int64_t
pos
)
{
avio_printf
(
out
,
"#EXT-X-MAP:URI=
\"
%s
\"
"
,
filename
);
avio_printf
(
out
,
"#EXT-X-MAP:URI=
\"
%s
\"
"
,
filename
);
if
(
byterange_mode
)
{
if
(
byterange_mode
)
{
avio_printf
(
out
,
",BYTERANGE=
\"
%"
PRId64
"@%"
PRId64
"
\"
"
,
size
,
pos
);
avio_printf
(
out
,
",BYTERANGE=
\"
%"
PRId64
"@%"
PRId64
"
\"
"
,
size
,
pos
);
...
@@ -127,12 +130,14 @@ void ff_hls_write_init_file(AVIOContext *out, const char *filename,
...
@@ -127,12 +130,14 @@ void ff_hls_write_init_file(AVIOContext *out, const char *filename,
}
}
int
ff_hls_write_file_entry
(
AVIOContext
*
out
,
int
insert_discont
,
int
ff_hls_write_file_entry
(
AVIOContext
*
out
,
int
insert_discont
,
int
byterange_mode
,
int
byterange_mode
,
double
duration
,
double
duration
,
int
round_duration
,
int
round_duration
,
int64_t
size
,
int64_t
size
,
int64_t
pos
,
//Used only if HLS_SINGLE_FILE flag is set
int64_t
pos
/* Used only if HLS_SINGLE_FILE flag is set */
,
const
char
*
baseurl
/* Ignored if NULL */
,
const
char
*
baseurl
/* Ignored if NULL */
,
const
char
*
filename
,
double
*
prog_date_time
,
const
char
*
filename
,
double
*
prog_date_time
,
int64_t
video_keyframe_size
,
int64_t
video_keyframe_pos
,
int
iframe_mode
)
{
int64_t
video_keyframe_size
,
int64_t
video_keyframe_pos
,
int
iframe_mode
)
{
if
(
!
out
||
!
filename
)
if
(
!
out
||
!
filename
)
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
...
@@ -181,7 +186,8 @@ int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
...
@@ -181,7 +186,8 @@ int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
return
0
;
return
0
;
}
}
void
ff_hls_write_end_list
(
AVIOContext
*
out
)
{
void
ff_hls_write_end_list
(
AVIOContext
*
out
)
{
if
(
!
out
)
if
(
!
out
)
return
;
return
;
avio_printf
(
out
,
"#EXT-X-ENDLIST
\n
"
);
avio_printf
(
out
,
"#EXT-X-ENDLIST
\n
"
);
...
...
libavformat/hlsplaylist.h
View file @
6c70f898
...
@@ -53,12 +53,13 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
...
@@ -53,12 +53,13 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
void
ff_hls_write_init_file
(
AVIOContext
*
out
,
const
char
*
filename
,
void
ff_hls_write_init_file
(
AVIOContext
*
out
,
const
char
*
filename
,
int
byterange_mode
,
int64_t
size
,
int64_t
pos
);
int
byterange_mode
,
int64_t
size
,
int64_t
pos
);
int
ff_hls_write_file_entry
(
AVIOContext
*
out
,
int
insert_discont
,
int
ff_hls_write_file_entry
(
AVIOContext
*
out
,
int
insert_discont
,
int
byterange_mode
,
int
byterange_mode
,
double
duration
,
double
duration
,
int
round_duration
,
int
round_duration
,
int64_t
size
,
int64_t
size
,
int64_t
pos
,
//Used only if HLS_SINGLE_FILE flag is set
int64_t
pos
/* Used only if HLS_SINGLE_FILE flag is set */
,
const
char
*
baseurl
/* Ignored if NULL */
,
const
char
*
baseurl
/* Ignored if NULL */
,
const
char
*
filename
,
double
*
prog_date_time
,
const
char
*
filename
,
double
*
prog_date_time
,
int64_t
video_keyframe_size
,
int64_t
video_keyframe_pos
,
int
iframe_mode
);
int64_t
video_keyframe_size
,
int64_t
video_keyframe_pos
,
int
iframe_mode
);
void
ff_hls_write_end_list
(
AVIOContext
*
out
);
void
ff_hls_write_end_list
(
AVIOContext
*
out
);
#endif
/* AVFORMAT_HLSPLAYLIST_H_ */
#endif
/* AVFORMAT_HLSPLAYLIST_H_ */
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