diff options
author | Karthick J <kjeyapal@akamai.com> | 2017-11-30 10:54:54 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2017-11-30 10:54:54 +0800 |
commit | 3684b5e56a54b850bd725ffc63cb454e23fd79db (patch) | |
tree | 2e1273853b2d421275425d6c27b60038b9d3d741 /libavformat/hlsplaylist.h | |
parent | c6a905b91d935f78f5c33f6ce2dbe294b3353b77 (diff) |
avformat/hlsenc: Refactored 'get_int_from_double' function to allow reuse
Diffstat (limited to 'libavformat/hlsplaylist.h')
-rw-r--r-- | libavformat/hlsplaylist.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h index 9263a6463b..4cbc8cacc9 100644 --- a/libavformat/hlsplaylist.h +++ b/libavformat/hlsplaylist.h @@ -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); |