From 22d2d3ac979559e8e799bf4df47ccd07a2631732 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sun, 27 Mar 2016 11:45:19 +0800 Subject: [PATCH] FS-8982 #resolve --- src/mod/applications/mod_fsv/mod_fsv.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mod/applications/mod_fsv/mod_fsv.c b/src/mod/applications/mod_fsv/mod_fsv.c index c709458dd9..e2c6f5af4d 100644 --- a/src/mod/applications/mod_fsv/mod_fsv.c +++ b/src/mod/applications/mod_fsv/mod_fsv.c @@ -367,7 +367,8 @@ SWITCH_STANDARD_APP(play_fsv_function) goto end; } switch_core_session_set_read_codec(session, &codec); - + switch_channel_set_flag(channel, CF_VIDEO_WRITING); + while (switch_channel_ready(channel)) { if (read(fd, &bytes, sizeof(bytes)) != sizeof(bytes)) { @@ -464,9 +465,8 @@ SWITCH_STANDARD_APP(play_fsv_function) switch_core_timer_destroy(&timer); } - switch_core_session_set_read_codec(session, NULL); - + switch_channel_clear_flag(channel, CF_VIDEO_WRITING); if (switch_core_codec_ready(&codec)) { switch_core_codec_destroy(&codec); @@ -510,6 +510,8 @@ SWITCH_STANDARD_APP(play_yuv_function) switch_channel_answer(channel); + switch_core_session_request_video_refresh(session); + switch_channel_audio_sync(channel); switch_core_session_raw_read(session); @@ -529,7 +531,7 @@ SWITCH_STANDARD_APP(play_yuv_function) done = switch_micro_time_now() + (to * 1000); } - switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); + // switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); while (switch_channel_ready(channel) && !switch_channel_test_flag(channel, CF_VIDEO)) { if ((++loops % 100) == 0) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Waiting for video......\n"); @@ -555,7 +557,7 @@ SWITCH_STANDARD_APP(play_yuv_function) yuv = img->planes[SWITCH_PLANE_PACKED]; - // switch_channel_set_flag(channel, CF_VIDEO_PASSIVE); + switch_channel_set_flag(channel, CF_VIDEO_WRITING); //SWITCH_RTP_MAX_BUF_LEN vid_buffer = switch_core_session_alloc(session, SWITCH_RTP_MAX_BUF_LEN); @@ -653,7 +655,7 @@ SWITCH_STANDARD_APP(play_yuv_function) switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE); switch_core_session_video_reset(session); - // switch_channel_clear_flag(channel, CF_VIDEO_PASSIVE); + switch_channel_clear_flag(channel, CF_VIDEO_WRITING); }