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
26e1efb0
Commit
26e1efb0
authored
Jan 02, 2018
by
Vishwanath Dixit
Committed by
Steven Liu
Jan 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hlsenc: revamped master playlist url creation logic
parent
21b5990d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
hlsenc.c
libavformat/hlsenc.c
+18
-16
No files found.
libavformat/hlsenc.c
View file @
26e1efb0
...
@@ -1689,28 +1689,30 @@ static int update_variant_stream_info(AVFormatContext *s) {
...
@@ -1689,28 +1689,30 @@ static int update_variant_stream_info(AVFormatContext *s) {
static
int
update_master_pl_info
(
AVFormatContext
*
s
)
{
static
int
update_master_pl_info
(
AVFormatContext
*
s
)
{
HLSContext
*
hls
=
s
->
priv_data
;
HLSContext
*
hls
=
s
->
priv_data
;
int
m3u8_name_size
,
ret
;
const
char
*
dir
;
char
*
p
;
char
*
fn
;
int
ret
=
0
;
m3u8_name_size
=
strlen
(
s
->
filename
)
+
strlen
(
hls
->
master_pl_name
)
+
1
;
fn
=
av_strdup
(
s
->
filename
);
hls
->
master_m3u8_url
=
av_malloc
(
m3u8_name_size
);
if
(
!
fn
)
{
if
(
!
hls
->
master_m3u8_url
)
{
ret
=
AVERROR
(
ENOMEM
);
ret
=
AVERROR
(
ENOMEM
);
return
ret
;
goto
fail
;
}
}
av_strlcpy
(
hls
->
master_m3u8_url
,
s
->
filename
,
m3u8_name_size
);
dir
=
av_dirname
(
fn
);
p
=
strrchr
(
hls
->
master_m3u8_url
,
'/'
)
?
if
(
dir
&&
strcmp
(
dir
,
"."
))
strrchr
(
hls
->
master_m3u8_url
,
'/'
)
:
hls
->
master_m3u8_url
=
av_append_path_component
(
dir
,
hls
->
master_pl_name
);
strrchr
(
hls
->
master_m3u8_url
,
'\\'
);
else
if
(
p
)
{
hls
->
master_m3u8_url
=
av_strdup
(
hls
->
master_pl_name
);
*
(
p
+
1
)
=
'\0'
;
av_strlcat
(
hls
->
master_m3u8_url
,
hls
->
master_pl_name
,
m3u8_name_size
);
if
(
!
hls
->
master_m3u8_url
)
{
}
else
{
ret
=
AVERROR
(
ENOMEM
);
av_strlcpy
(
hls
->
master_m3u8_url
,
hls
->
master_pl_name
,
m3u8_name_size
)
;
goto
fail
;
}
}
return
0
;
fail:
av_freep
(
&
fn
);
return
ret
;
}
}
static
int
hls_write_header
(
AVFormatContext
*
s
)
static
int
hls_write_header
(
AVFormatContext
*
s
)
...
...
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