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
2a5891bb
Commit
2a5891bb
authored
Jul 22, 2013
by
Zhang Rui
Committed by
Michael Niedermayer
Jul 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hls: parse EXTINF duration as floating-point number
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
47d57f24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
hls.c
libavformat/hls.c
+5
-4
No files found.
libavformat/hls.c
View file @
2a5891bb
...
...
@@ -56,7 +56,7 @@ enum KeyType {
};
struct
segment
{
int
duration
;
double
duration
;
char
url
[
MAX_URL_SIZE
];
char
key
[
MAX_URL_SIZE
];
enum
KeyType
key_type
;
...
...
@@ -206,7 +206,8 @@ static void handle_key_args(struct key_info *info, const char *key,
static
int
parse_playlist
(
HLSContext
*
c
,
const
char
*
url
,
struct
variant
*
var
,
AVIOContext
*
in
)
{
int
ret
=
0
,
duration
=
0
,
is_segment
=
0
,
is_variant
=
0
,
bandwidth
=
0
;
int
ret
=
0
,
is_segment
=
0
,
is_variant
=
0
,
bandwidth
=
0
;
double
duration
=
0
.
0
;
enum
KeyType
key_type
=
KEY_NONE
;
uint8_t
iv
[
16
]
=
""
;
int
has_iv
=
0
;
...
...
@@ -286,7 +287,7 @@ static int parse_playlist(HLSContext *c, const char *url,
var
->
finished
=
1
;
}
else
if
(
av_strstart
(
line
,
"#EXTINF:"
,
&
ptr
))
{
is_segment
=
1
;
duration
=
ato
i
(
ptr
);
duration
=
ato
f
(
ptr
);
}
else
if
(
av_strstart
(
line
,
"#"
,
NULL
))
{
continue
;
}
else
if
(
line
[
0
])
{
...
...
@@ -523,7 +524,7 @@ static int hls_read_header(AVFormatContext *s)
/* If this isn't a live stream, calculate the total duration of the
* stream. */
if
(
c
->
variants
[
0
]
->
finished
)
{
int64_t
duration
=
0
;
double
duration
=
0
.
0
;
for
(
i
=
0
;
i
<
c
->
variants
[
0
]
->
n_segments
;
i
++
)
duration
+=
c
->
variants
[
0
]
->
segments
[
i
]
->
duration
;
s
->
duration
=
duration
*
AV_TIME_BASE
;
...
...
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