]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11895: [build] fix test build
authorMike Jerris <mike@signalwire.com>
Thu, 27 Jun 2019 20:42:33 +0000 (16:42 -0400)
committerMike Jerris <mike@signalwire.com>
Thu, 27 Jun 2019 20:43:04 +0000 (16:43 -0400)
src/mod/applications/mod_av/test/test_mod_av.c

index 51e594f344ece8ee1c4feba09be84039a77aaa7e..14ee022daba0d9a9acc8232117a0df46403e070a 100644 (file)
@@ -50,9 +50,10 @@ static fctcl_init_t my_cl_options[] = {
 
 FST_CORE_BEGIN("conf")
 {
+        const char *loop_;
        fctcl_install(my_cl_options);
 
-       const char *loop_ = fctcl_val("--loop");
+       loop_ = fctcl_val("--loop");
        if (loop_) loop = atoi(loop_);
 
        FST_MODULE_BEGIN(mod_av, mod_av_test)
@@ -68,6 +69,11 @@ FST_CORE_BEGIN("conf")
                        switch_status_t status;
                        switch_codec_t codec = { 0 };
                        switch_codec_settings_t codec_settings = { 0 };
+                       switch_image_t *img;
+                       uint8_t buf[SWITCH_DEFAULT_VIDEO_SIZE + 12];
+                       switch_frame_t frame = { 0 };
+                       int packets = 0;
+                       switch_status_t encode_status;
 
                        // switch_set_string(codec_settings.video.config_profile_name, "conference");
 
@@ -85,11 +91,9 @@ FST_CORE_BEGIN("conf")
                                                           &codec_settings, fst_pool);
                        fst_check(status == SWITCH_STATUS_SUCCESS);
 
-                       switch_image_t *img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, 1280, 720, 1);
+                       img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, 1280, 720, 1);
                        fst_requires(img);
 
-                       uint8_t buf[SWITCH_DEFAULT_VIDEO_SIZE + 12];
-                       switch_frame_t frame = { 0 };
 
                        frame.packet = buf;
                        frame.packetlen = SWITCH_DEFAULT_VIDEO_SIZE + 12;
@@ -101,9 +105,6 @@ FST_CORE_BEGIN("conf")
                        frame.timestamp = 0;
                        frame.img = img;
 
-                       int packets = 0;
-                       switch_status_t encode_status;
-
                        do {
                                frame.datalen = SWITCH_DEFAULT_VIDEO_SIZE;
                                encode_status = switch_core_codec_encode_video(&codec, &frame);