int max;
int samples;
switch_file_handle_t *audio_fh;
+ int done;
};
typedef struct png_file_context png_file_context_t;
if (context->audio_fh) switch_core_file_close(context->audio_fh);
+ context->done = 1;
+
return SWITCH_STATUS_SUCCESS;
}
png_file_context_t *context = (png_file_context_t *)handle->private_info;
+ if (context->done) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if (context->audio_fh) {
return switch_core_file_read(context->audio_fh, data, len);
}
switch_image_t *dup = NULL;
int have_frame = 0;
+ if (context->done) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if ((flags & SVR_CHECK)) {
return SWITCH_STATUS_BREAK;
}
switch_mutex_unlock(v_engine->mh.file_read_mutex);
} else {
+ if (!fh && smh->video_write_thread) {
+ if (smh->video_write_thread_running > 0) {
+ smh->video_write_thread_running = -1;
+ }
+ }
+
switch_mutex_lock(v_engine->mh.file_write_mutex);
+
if (fh && smh->video_write_fh) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "File is already open\n");
smh->video_write_fh = fh;