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
28bb73ce
Commit
28bb73ce
authored
Sep 24, 2019
by
Limin Wang
Committed by
Steven Liu
Oct 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hlsenc: replace with av_dirname to get the directory
Signed-off-by:
Limin Wang
<
lance.lmwang@gmail.com
>
parent
61aa7727
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
hlsenc.c
libavformat/hlsenc.c
+6
-16
No files found.
libavformat/hlsenc.c
View file @
28bb73ce
...
@@ -486,7 +486,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
...
@@ -486,7 +486,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
float
playlist_duration
=
0
.
0
f
;
float
playlist_duration
=
0
.
0
f
;
int
ret
=
0
,
path_size
,
sub_path_size
;
int
ret
=
0
,
path_size
,
sub_path_size
;
int
segment_cnt
=
0
;
int
segment_cnt
=
0
;
char
*
dirname
=
NULL
,
*
p
,
*
sub_path
;
char
*
dirname
=
NULL
,
*
sub_path
;
char
*
path
=
NULL
;
char
*
path
=
NULL
;
char
*
vtt_dirname
=
NULL
;
char
*
vtt_dirname
=
NULL
;
AVDictionary
*
options
=
NULL
;
AVDictionary
*
options
=
NULL
;
...
@@ -517,13 +517,8 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
...
@@ -517,13 +517,8 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
}
}
if
(
segment
&&
!
hls
->
use_localtime_mkdir
)
{
if
(
segment
&&
!
hls
->
use_localtime_mkdir
)
{
dirname
=
hls
->
segment_filename
?
av_strdup
(
hls
->
segment_filename
)
:
av_strdup
(
vs
->
avf
->
url
);
char
*
dirname_r
=
hls
->
segment_filename
?
av_strdup
(
hls
->
segment_filename
)
:
av_strdup
(
vs
->
avf
->
url
);
if
(
!
dirname
)
{
dirname
=
(
char
*
)
av_dirname
(
dirname_r
);
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
p
=
(
char
*
)
av_basename
(
dirname
);
*
p
=
'\0'
;
}
}
/* if %v is present in the file's directory
/* if %v is present in the file's directory
...
@@ -542,7 +537,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
...
@@ -542,7 +537,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
}
}
}
}
av_free
(
dirname
);
av_free
p
(
&
dirname
);
dirname
=
r_dirname
;
dirname
=
r_dirname
;
}
}
...
@@ -578,13 +573,8 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
...
@@ -578,13 +573,8 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
}
}
if
((
segment
->
sub_filename
[
0
]
!=
'\0'
))
{
if
((
segment
->
sub_filename
[
0
]
!=
'\0'
))
{
vtt_dirname
=
av_strdup
(
vs
->
vtt_avf
->
url
);
char
*
vtt_dirname_r
=
av_strdup
(
vs
->
vtt_avf
->
url
);
if
(
!
vtt_dirname
)
{
vtt_dirname
=
(
char
*
)
av_dirname
(
vtt_dirname_r
);
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
p
=
(
char
*
)
av_basename
(
vtt_dirname
);
*
p
=
'\0'
;
sub_path_size
=
strlen
(
segment
->
sub_filename
)
+
1
+
strlen
(
vtt_dirname
);
sub_path_size
=
strlen
(
segment
->
sub_filename
)
+
1
+
strlen
(
vtt_dirname
);
sub_path
=
av_malloc
(
sub_path_size
);
sub_path
=
av_malloc
(
sub_path_size
);
if
(
!
sub_path
)
{
if
(
!
sub_path
)
{
...
...
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