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
3684b5e5
Commit
3684b5e5
authored
Nov 30, 2017
by
Karthick J
Committed by
Steven Liu
Nov 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hlsenc: Refactored 'get_int_from_double' function to allow reuse
parent
c6a905b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
hlsenc.c
libavformat/hlsenc.c
+1
-6
hlsplaylist.h
libavformat/hlsplaylist.h
+5
-0
No files found.
libavformat/hlsenc.c
View file @
3684b5e5
...
...
@@ -203,11 +203,6 @@ typedef struct HLSContext {
int
http_persistent
;
}
HLSContext
;
static
int
get_int_from_double
(
double
val
)
{
return
(
int
)((
val
-
(
int
)
val
)
>=
0
.
001
)
?
(
int
)(
val
+
1
)
:
(
int
)
val
;
}
static
int
mkdir_p
(
const
char
*
path
)
{
int
ret
=
0
;
char
*
temp
=
av_strdup
(
path
);
...
...
@@ -1211,7 +1206,7 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
for
(
en
=
vs
->
segments
;
en
;
en
=
en
->
next
)
{
if
(
target_duration
<=
en
->
duration
)
target_duration
=
get_int_from_double
(
en
->
duration
);
target_duration
=
hls_
get_int_from_double
(
en
->
duration
);
}
vs
->
discontinuity_set
=
0
;
...
...
libavformat/hlsplaylist.h
View file @
3684b5e5
...
...
@@ -36,6 +36,11 @@ typedef enum {
PLAYLIST_TYPE_NB
,
}
PlaylistType
;
static
inline
int
hls_get_int_from_double
(
double
val
)
{
return
(
int
)((
val
-
(
int
)
val
)
>=
0
.
001
)
?
(
int
)(
val
+
1
)
:
(
int
)
val
;
}
void
ff_hls_write_playlist_version
(
AVIOContext
*
out
,
int
version
);
void
ff_hls_write_stream_info
(
AVStream
*
st
,
AVIOContext
*
out
,
int
bandwidth
,
char
*
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