FS-7500: don't wait for video ready from inside video thread that sets that flag

This commit is contained in:
Anthony Minessale authored and Michael Jerris committed 2015-05-28 12:47:11 -05:00
1 parent 24254bb1fd
commit fdcfcaece9
4 files changed
+32 -10

No files matched your search

+6 -4
View File
@@ -670,10 +670,6 @@ static void decode_video_thread(switch_core_session_t *session, void *obj)
goto done;
}
switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ);
switch_channel_set_flag(channel, CF_VIDEO_DEBUG_READ);
switch_channel_set_flag(channel, CF_VIDEO_DEBUG_WRITE);
while (switch_channel_ready(channel)) {
switch_status_t status = switch_core_session_read_video_frame(session, &frame, SWITCH_IO_FLAG_NONE, 0);
@@ -687,6 +683,7 @@ static void decode_video_thread(switch_core_session_t *session, void *obj)
}
if (frame && frame->datalen > 0) {
printf("WTF %p\n", (void *)frame->img);
switch_core_session_write_video_frame(session, frame, SWITCH_IO_FLAG_NONE, 0);
} else {
continue;
@@ -733,6 +730,11 @@ SWITCH_STANDARD_APP(decode_video_function)
switch_channel_answer(channel);
switch_core_session_request_video_refresh(session);
switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ);
switch_channel_set_flag(channel, CF_VIDEO_DEBUG_READ);
switch_channel_set_flag(channel, CF_VIDEO_DEBUG_WRITE);
switch_core_media_start_video_function(session, decode_video_thread, &max_pictures);
switch_ivr_play_file(session, NULL, moh, NULL);