Commit 2f7cc21b authored by Steven Liu's avatar Steven Liu

avformat/hlsenc: refine the code readable for time unit

Reviewed-by: 's avatarBodecs Bela <bodecsb@vivanet.hu>
Reviewed-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
parent b7665642
...@@ -47,6 +47,7 @@ typedef enum { ...@@ -47,6 +47,7 @@ typedef enum {
#define KEYSIZE 16 #define KEYSIZE 16
#define LINE_BUFFER_SIZE 1024 #define LINE_BUFFER_SIZE 1024
#define HLS_MICROSECOND_UNIT 1000000
typedef struct HLSSegment { typedef struct HLSSegment {
char filename[1024]; char filename[1024];
...@@ -501,7 +502,7 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double ...@@ -501,7 +502,7 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
if (replace_int_data_in_filename(hls->avf->filename, sizeof(hls->avf->filename), if (replace_int_data_in_filename(hls->avf->filename, sizeof(hls->avf->filename),
filename, 't', (int64_t)round(1000000 * duration)) < 1) { filename, 't', (int64_t)round(duration * HLS_MICROSECOND_UNIT)) < 1) {
av_log(hls, AV_LOG_ERROR, av_log(hls, AV_LOG_ERROR,
"Invalid second level segment filename template '%s', " "Invalid second level segment filename template '%s', "
"you can try to remove second_level_segment_time flag\n", "you can try to remove second_level_segment_time flag\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment