Skip to content
Snippets Groups Projects
Commit 93a0e478 authored by Karthick J's avatar Karthick J Committed by Steven Liu
Browse files

avformat/hlsenc: set EXT-X-TARGETDURATION use lrint(EXTINF)

parent e403e4bd
No related branches found
No related tags found
No related merge requests found
...@@ -1235,7 +1235,7 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs) ...@@ -1235,7 +1235,7 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
for (en = vs->segments; en; en = en->next) { for (en = vs->segments; en; en = en->next) {
if (target_duration <= en->duration) if (target_duration <= en->duration)
target_duration = hls_get_int_from_double(en->duration); target_duration = lrint(en->duration);
} }
vs->discontinuity_set = 0; vs->discontinuity_set = 0;
......
...@@ -36,11 +36,6 @@ typedef enum { ...@@ -36,11 +36,6 @@ typedef enum {
PLAYLIST_TYPE_NB, PLAYLIST_TYPE_NB,
} PlaylistType; } 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_playlist_version(AVIOContext *out, int version);
void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, void ff_hls_write_stream_info(AVStream *st, AVIOContext *out,
int bandwidth, char *filename); int bandwidth, char *filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment