mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
added chunk size fix
This commit is contained in:
@ -204,7 +204,7 @@ ngx_rtmp_init_connection(ngx_connection_t *c)
|
|||||||
c->log->connection = c->number;
|
c->log->connection = c->number;
|
||||||
c->log->handler = ngx_rtmp_log_error;
|
c->log->handler = ngx_rtmp_log_error;
|
||||||
c->log->data = ctx;
|
c->log->data = ctx;
|
||||||
c->log->action = "sending client greeting line";
|
c->log->action = NULL;
|
||||||
|
|
||||||
c->log_error = NGX_ERROR_INFO;
|
c->log_error = NGX_ERROR_INFO;
|
||||||
|
|
||||||
@ -1138,6 +1138,7 @@ ngx_rtmp_set_chunk_size(ngx_rtmp_session_t *s, ngx_uint_t size)
|
|||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
bi = li->buf;
|
bi = li->buf;
|
||||||
bo = lo->buf;
|
bo = lo->buf;
|
||||||
|
|
||||||
if (bo->end - bo->last >= bi->last - bi->pos) {
|
if (bo->end - bo->last >= bi->last - bi->pos) {
|
||||||
bo->last = ngx_cpymem(bo->last, bi->pos,
|
bo->last = ngx_cpymem(bo->last, bi->pos,
|
||||||
bi->last - bi->pos);
|
bi->last - bi->pos);
|
||||||
@ -1147,17 +1148,15 @@ ngx_rtmp_set_chunk_size(ngx_rtmp_session_t *s, ngx_uint_t size)
|
|||||||
s->in_streams[n].in = lo;
|
s->in_streams[n].in = lo;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
continue;
|
||||||
bo->last = ngx_cpymem(bo->last, bi->pos,
|
|
||||||
bo->end - bo->last);
|
|
||||||
bi->pos += (bo->end - bo->last);
|
|
||||||
}
|
}
|
||||||
if (bo->last == bo->end) {
|
|
||||||
lo->next = ngx_rtmp_alloc_in_buf(s);
|
bi->pos += (ngx_cpymem(bo->last, bi->pos,
|
||||||
if (lo->next == NULL) {
|
bo->end - bo->last) - bo->last);
|
||||||
return NGX_ERROR;
|
lo->next = ngx_rtmp_alloc_in_buf(s);
|
||||||
}
|
lo = lo->next;
|
||||||
lo = lo->next;
|
if (lo == NULL) {
|
||||||
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user