summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorKarthick J <kjeyapal@akamai.com>2017-11-30 10:54:54 +0800
committerSteven Liu <lq@chinaffmpeg.org>2017-11-30 10:54:54 +0800
commit3684b5e56a54b850bd725ffc63cb454e23fd79db (patch)
tree2e1273853b2d421275425d6c27b60038b9d3d741 /libavformat/hlsenc.c
parentc6a905b91d935f78f5c33f6ce2dbe294b3353b77 (diff)
avformat/hlsenc: Refactored 'get_int_from_double' function to allow reuse
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f63b08d709..cdfbf45823 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -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;