mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-06-01 06:09:32 +02:00
Merge branch 'master' into hlslight
This commit is contained in:
commit
1d44a18ad2
|
@ -145,6 +145,8 @@ ngx_rtmp_codec_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||
uint8_t fmt;
|
||||
ngx_rtmp_header_t ch, lh;
|
||||
ngx_uint_t *version;
|
||||
static ngx_uint_t sample_rates[] =
|
||||
{ 5512, 11025, 22050, 44100 };
|
||||
|
||||
|
||||
if (h->type != NGX_RTMP_MSG_AUDIO && h->type != NGX_RTMP_MSG_VIDEO) {
|
||||
|
@ -165,6 +167,9 @@ ngx_rtmp_codec_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||
fmt = in->buf->pos[0];
|
||||
if (h->type == NGX_RTMP_MSG_AUDIO) {
|
||||
ctx->audio_codec_id = (fmt & 0xf0) >> 4;
|
||||
ctx->audio_channels = (fmt & 0x01) + 1;
|
||||
ctx->sample_size = (fmt & 0x02) ? 2 : 1;
|
||||
ctx->sample_rate = sample_rates[(fmt & 0x0c) >> 2];
|
||||
} else {
|
||||
ctx->video_codec_id = (fmt & 0x0f);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,9 @@ typedef struct {
|
|||
ngx_uint_t video_codec_id;
|
||||
ngx_uint_t audio_data_rate;
|
||||
ngx_uint_t audio_codec_id;
|
||||
ngx_uint_t sample_rate; /* 5512, 11025, 22050, 44100 */
|
||||
ngx_uint_t sample_size; /* 1=8bit, 2=16bit */
|
||||
ngx_uint_t audio_channels; /* 1, 2 */
|
||||
u_char profile[32];
|
||||
u_char level[32];
|
||||
|
||||
|
|
|
@ -219,9 +219,7 @@ ngx_rtmp_live_delete_stream(ngx_rtmp_session_t *s, ngx_rtmp_delete_stream_t *v)
|
|||
ngx_rtmp_live_ctx_t *ctx, **cctx;
|
||||
ngx_rtmp_live_stream_t **stream;
|
||||
ngx_rtmp_live_app_conf_t *lacf;
|
||||
ngx_rtmp_core_srv_conf_t *cscf;
|
||||
|
||||
cscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_core_module);
|
||||
lacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_live_module);
|
||||
if (lacf == NULL) {
|
||||
goto next;
|
||||
|
|
Loading…
Reference in a new issue