diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index 2332572..844dbfa 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -263,6 +263,7 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s) #define NGX_RTMP_DASH_MANIFEST_VIDEO \ " \n" \ " buf->pos += 2; - return ngx_rtmp_dash_append(s, in, &ctx->audio, 0, h->timestamp); + return ngx_rtmp_dash_append(s, in, &ctx->audio, 0, h->timestamp, 0); } @@ -1016,7 +1018,9 @@ static ngx_int_t ngx_rtmp_dash_video(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, ngx_chain_t *in) { + u_char *p; uint8_t ftype, htype; + uint32_t delay; ngx_rtmp_dash_ctx_t *ctx; ngx_rtmp_codec_ctx_t *codec_ctx; ngx_rtmp_dash_app_conf_t *dacf; @@ -1049,6 +1053,14 @@ ngx_rtmp_dash_video(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, if (htype != 1) { return NGX_OK; } + + p = (u_char *) &delay; + + p[0] = in->buf->pos[4]; + p[1] = in->buf->pos[3]; + p[2] = in->buf->pos[2]; + p[3] = 0; + ctx->has_video = 1; @@ -1056,7 +1068,8 @@ ngx_rtmp_dash_video(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, in->buf->pos += 5; - return ngx_rtmp_dash_append(s, in, &ctx->video, ftype == 1, h->timestamp); + return ngx_rtmp_dash_append(s, in, &ctx->video, ftype == 1, h->timestamp, + delay); }