From 857eca9a6158e6a324dddc9d2ea2150070ea0619 Mon Sep 17 00:00:00 2001 From: Stephen Basile Date: Mon, 30 Sep 2013 17:56:37 -0400 Subject: [PATCH] fix precision on duration --- hls/ngx_rtmp_dash_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hls/ngx_rtmp_dash_module.c b/hls/ngx_rtmp_dash_module.c index 091d8c5..c30a381 100644 --- a/hls/ngx_rtmp_dash_module.c +++ b/hls/ngx_rtmp_dash_module.c @@ -230,7 +230,7 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s) f = ngx_rtmp_dash_get_frag(s, hacf->winfrags/2); - audio_dur = f->id > 0 ? (uint32_t)(codec_ctx->sample_rate*((f->video_latest_pres_time/f->id)/1000)) : + audio_dur = f->id > 0 ? (uint32_t)(codec_ctx->sample_rate*((float)(f->video_latest_pres_time/f->id)/1000.0)) : (uint32_t)(codec_ctx->sample_rate*(hacf->fraglen/1000)); p = ngx_snprintf(buffer, sizeof(buffer), NGX_RTMP_DASH_MANIFEST_HEADER,