fixed type casting

This commit is contained in:
Roman Arutyunyan 2013-06-12 00:13:50 +04:00
parent 56b54b1215
commit 49f8f4d097
6 changed files with 20 additions and 20 deletions

View file

@ -288,8 +288,8 @@ ngx_rtmp_cmd_connect(ngx_rtmp_session_t *s, ngx_rtmp_connect_t *v)
s->app.len = (p - s->app.data);
}
s->acodecs = v->acodecs;
s->vcodecs = v->vcodecs;
s->acodecs = (uint32_t) v->acodecs;
s->vcodecs = (uint32_t) v->vcodecs;
/* find application & set app_conf */
cacfp = cscf->applications.elts;

View file

@ -532,16 +532,16 @@ ngx_rtmp_codec_meta_data(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
return NGX_OK;
}
ctx->width = v.width;
ctx->height = v.height;
ctx->duration = v.duration;
ctx->frame_rate = v.frame_rate;
ctx->video_data_rate = v.video_data_rate;
ctx->video_codec_id = v.video_codec_id_n;
ctx->audio_data_rate = v.audio_data_rate;
ctx->width = (ngx_uint_t) v.width;
ctx->height = (ngx_uint_t) v.height;
ctx->duration = (ngx_uint_t) v.duration;
ctx->frame_rate = (ngx_uint_t) v.frame_rate;
ctx->video_data_rate = (ngx_uint_t) v.video_data_rate;
ctx->video_codec_id = (ngx_uint_t) v.video_codec_id_n;
ctx->audio_data_rate = (ngx_uint_t) v.audio_data_rate;
ctx->audio_codec_id = (v.audio_codec_id_n == -1
? 0 : v.audio_codec_id_n == 0
? NGX_RTMP_AUDIO_UNCOMPRESSED : v.audio_codec_id_n);
? NGX_RTMP_AUDIO_UNCOMPRESSED : (ngx_uint_t) v.audio_codec_id_n);
ngx_memcpy(ctx->profile, v.profile, sizeof(v.profile));
ngx_memcpy(ctx->level, v.level, sizeof(v.level));

View file

@ -291,7 +291,7 @@ ngx_rtmp_flv_timestamp_to_offset(ngx_rtmp_session_t *s, ngx_file_t *f,
goto rewind;
}
ret = ngx_rtmp_flv_index_value(ngx_rtmp_flv_buffer);
ret = (ngx_uint_t) ngx_rtmp_flv_index_value(ngx_rtmp_flv_buffer);
ngx_log_debug2(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"flv: lookup index timestamp=%i offset=%ui",

View file

@ -184,7 +184,7 @@ static void
ngx_rtmp_fill_random_buffer(ngx_buf_t *b)
{
for (; b->last != b->end; ++b->last) {
*b->last = rand();
*b->last = (u_char) rand();
}
}

View file

@ -539,7 +539,7 @@ ngx_rtmp_mp4_parse_video(ngx_rtmp_session_t *s, u_char *pos, u_char *last,
return NGX_ERROR;
}
ctx->track->fhdr = ctx->track->codec;
ctx->track->fhdr = (u_char) ctx->track->codec;
return NGX_OK;
}
@ -1330,7 +1330,7 @@ ngx_rtmp_mp4_update_offset(ngx_rtmp_session_t *s, ngx_rtmp_mp4_track_t *t)
return NGX_ERROR;
}
cr->offset = ngx_rtmp_r32(t->offsets->entries[chunk]);
cr->offset = (off_t) ngx_rtmp_r32(t->offsets->entries[chunk]);
cr->size = 0;
ngx_log_debug4(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
@ -1352,7 +1352,7 @@ ngx_rtmp_mp4_update_offset(ngx_rtmp_session_t *s, ngx_rtmp_mp4_track_t *t)
return NGX_ERROR;
}
cr->offset = ngx_rtmp_r32(t->offsets64->entries[chunk]);
cr->offset = (off_t) ngx_rtmp_r64(t->offsets64->entries[chunk]);
cr->size = 0;
ngx_log_debug4(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
@ -2043,7 +2043,7 @@ ngx_rtmp_mp4_send(ngx_rtmp_session_t *s, ngx_file_t *f, ngx_uint_t *ts)
ngx_memzero(&h, sizeof(h));
h.msid = NGX_RTMP_MSID;
h.type = t->type;
h.type = (uint8_t) t->type;
h.csid = t->csid;
lh = h;
@ -2234,7 +2234,7 @@ ngx_rtmp_mp4_init(ngx_rtmp_session_t *s, ngx_file_t *f, ngx_int_t aindex,
return NGX_ERROR;
}
size = ngx_rtmp_r32(hdr[0]);
size = (size_t) ngx_rtmp_r32(hdr[0]);
shift = sizeof(hdr);
if (size == 1) {
@ -2248,7 +2248,7 @@ ngx_rtmp_mp4_init(ngx_rtmp_session_t *s, ngx_file_t *f, ngx_int_t aindex,
return NGX_ERROR;
}
size = ngx_rtmp_r64(extended_size);
size = (size_t) ngx_rtmp_r64(extended_size);
shift += sizeof(extended_size);
} else if (size == 0) {

View file

@ -578,7 +578,7 @@ ngx_rtmp_play_seek(ngx_rtmp_session_t *s, ngx_rtmp_seek_t *v)
}
if (!ctx->opened) {
ctx->post_seek = v->offset;
ctx->post_seek = (ngx_uint_t) v->offset;
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"play: post seek=%ui", ctx->post_seek);
goto next;
@ -588,7 +588,7 @@ ngx_rtmp_play_seek(ngx_rtmp_session_t *s, ngx_rtmp_seek_t *v)
return NGX_ERROR;
}
ngx_rtmp_play_do_seek(s, v->offset);
ngx_rtmp_play_do_seek(s, (ngx_uint_t) v->offset);
if (ngx_rtmp_send_status(s, "NetStream.Seek.Notify", "status", "Seeking")
!= NGX_OK)