]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10527: [mod_av] AV tweaks
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 27 Sep 2017 17:58:04 +0000 (12:58 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 27 Sep 2017 17:58:14 +0000 (12:58 -0500)
src/mod/applications/mod_av/avformat.c

index 2fc3459f121d0791b64456f0780d82cba47fc35b..471bc48dffee044c495ea849dad0df656dd25341 100644 (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);