diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index 3d96f06..012f53e 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -231,7 +231,7 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s) static u_char buffer[NGX_RTMP_DASH_BUFSIZE]; static u_char start_time[sizeof("1970-09-28T12:00:00+06:00")]; static u_char end_time[sizeof("1970-09-28T12:00:00+06:00")]; - static u_char buffer_depth[sizeof("PT1234H00M00.00S")]; + static u_char buffer_depth[sizeof("PT000D00H00M00.00S")]; static u_char frame_rate[(NGX_INT_T_LEN * 2) + 2]; dacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_dash_module); @@ -374,14 +374,14 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s) ngx_rtmp_dash_get_frag(s, 0)->timestamp); depth_hour = (ngx_uint_t) (depth_msec / 3600 / 1000); - depth_msec -= depth_hour * 3600000; + depth_msec -= depth_hour * (3600 * 1000); depth_min = (ngx_uint_t) (depth_msec / 60 / 1000); - depth_msec -= depth_min * 60000; + depth_msec -= depth_min * (60 * 1000); *ngx_sprintf(buffer_depth, "PT%dH%02dM%02d.%02dS", depth_hour, depth_min, (ngx_uint_t) (depth_msec / 1000), - depth_msec % 1000); + (ngx_uint_t) ((depth_msec % 1000) / 10)); last = buffer + sizeof(buffer);