FS-10527: [mod_av] AV tweaks

This commit is contained in:
Anthony Minessale 2017-09-27 12:58:04 -05:00
parent d9d34a8f1c
commit 86911858e8
1 changed files with 8 additions and 8 deletions

View File

@ -377,7 +377,7 @@ static switch_status_t add_stream(av_file_context_t *context, MediaStream *mst,
{
AVCodecContext *c;
switch_status_t status = SWITCH_STATUS_FALSE;
int threads = switch_core_cpu_count();
//int threads = switch_core_cpu_count();
int buffer_bytes = 2097152; /* 2 mb */
int fps = 15;
@ -406,9 +406,9 @@ GCC_DIAG_OFF(deprecated-declarations)
GCC_DIAG_ON(deprecated-declarations)
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "id:%d den:%d num:%d\n", mst->st->id, mst->st->time_base.den, mst->st->time_base.num);
if (threads > 4) {
threads = 4;
}
//if (threads > 4) {
// threads = 4;
// }
switch ((*codec)->type) {
case AVMEDIA_TYPE_AUDIO:
@ -471,7 +471,7 @@ GCC_DIAG_ON(deprecated-declarations)
c->time_base.num = 1;
c->gop_size = 25; /* emit one intra frame every x frames at mmst */
c->pix_fmt = AV_PIX_FMT_YUV420P;
c->thread_count = threads;
//c->thread_count = threads;
c->rc_initial_buffer_occupancy = buffer_bytes * 8;
if (codec_id == AV_CODEC_ID_H264) {
@ -604,10 +604,10 @@ GCC_DIAG_OFF(deprecated-declarations)
AVCodecContext *c = mst->st->codec;
GCC_DIAG_ON(deprecated-declarations)
switch_status_t status = SWITCH_STATUS_FALSE;
int threads = switch_core_cpu_count();
//int threads = switch_core_cpu_count();
if (threads > 4) threads = 4;
c->thread_count = threads;
// if (threads > 4) threads = 4;
// c->thread_count = threads;
/* open the codec */
ret = avcodec_open2(c, codec, NULL);