context->seek_ts = samples / handle->native_rate * AV_TIME_BASE;
*cur_sample = context->seek_ts;
+ context->closed = 0;
if (!context->file_read_thread_running) {
switch_threadattr_t *thd_attr = NULL;
}
switch_mutex_unlock(context->mutex);
- if (!context->file_read_thread_running && switch_buffer_inuse(context->audio_buffer) == 0) {
+ if (context->closed || (!context->file_read_thread_running && switch_buffer_inuse(context->audio_buffer) == 0)) {
*len = 0;
return SWITCH_STATUS_FALSE;
}
}
context->vid_ready = 1;
}
-
+ if (!frame->img) context->closed = 1;
return frame->img ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
}
#endif