mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
fixed sync after channel restart
This commit is contained in:
@ -674,7 +674,7 @@ ngx_rtmp_live_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||||||
ngx_rtmp_live_app_conf_t *lacf;
|
ngx_rtmp_live_app_conf_t *lacf;
|
||||||
ngx_rtmp_session_t *ss;
|
ngx_rtmp_session_t *ss;
|
||||||
ngx_rtmp_header_t ch, lh, clh;
|
ngx_rtmp_header_t ch, lh, clh;
|
||||||
ngx_int_t rc, mandatory;
|
ngx_int_t rc, mandatory, dummy_audio;
|
||||||
ngx_uint_t prio;
|
ngx_uint_t prio;
|
||||||
ngx_uint_t peers;
|
ngx_uint_t peers;
|
||||||
ngx_uint_t meta_version;
|
ngx_uint_t meta_version;
|
||||||
@ -870,12 +870,16 @@ ngx_rtmp_live_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dummy_audio = 0;
|
||||||
if (lacf->wait_video && h->type == NGX_RTMP_MSG_VIDEO &&
|
if (lacf->wait_video && h->type == NGX_RTMP_MSG_VIDEO &&
|
||||||
aapkt == NULL)
|
!pctx->cs[1].active)
|
||||||
{
|
{
|
||||||
|
dummy_audio = 1;
|
||||||
|
if (aapkt == NULL) {
|
||||||
aapkt = ngx_rtmp_alloc_shared_buf(cscf);
|
aapkt = ngx_rtmp_alloc_shared_buf(cscf);
|
||||||
ngx_rtmp_prepare_message(s, &clh, NULL, aapkt);
|
ngx_rtmp_prepare_message(s, &clh, NULL, aapkt);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (header || coheader) {
|
if (header || coheader) {
|
||||||
|
|
||||||
@ -908,7 +912,7 @@ ngx_rtmp_live_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (aapkt) {
|
} else if (dummy_audio) {
|
||||||
ngx_rtmp_send_message(ss, aapkt, 0);
|
ngx_rtmp_send_message(ss, aapkt, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -938,7 +942,7 @@ ngx_rtmp_live_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||||||
|
|
||||||
++peers;
|
++peers;
|
||||||
|
|
||||||
if (aapkt) {
|
if (dummy_audio) {
|
||||||
ngx_rtmp_send_message(ss, aapkt, 0);
|
ngx_rtmp_send_message(ss, aapkt, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user