int newres;
int serno;
int pop_count;
+ int video_flushes;
switch_size_t blank;
switch_image_t *banner_img;
switch_time_t banner_timeout;
switch_mutex_lock(source->mutex);
if (source->context_list) {
if (source->total == 1) {
- switch_queue_push(source->context_list->video_q, img);
+ if (switch_queue_trypush(source->context_list->video_q, img) != SWITCH_STATUS_SUCCESS) {
+ flush_video_queue(source->context_list->video_q);
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Flushing video queue\n");
+ if (++source->context_list->video_flushes > 1) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Disconnecting file\n");
+ source->context_list->ready = 0;
+ }
+ } else {
+ source->context_list->video_flushes = 0;
+ }
} else {
for (cp = source->context_list; cp && RUNNING; cp = cp->next) {
if (imgcp) {
if (switch_queue_trypush(cp->video_q, imgcp) != SWITCH_STATUS_SUCCESS) {
flush_video_queue(cp->video_q);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Flushing video queue\n");
+ if (++cp->video_flushes > 1) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Disconnecting file\n");
+ cp->ready = 0;
+ }
+ } else {
+ cp->video_flushes = 0;
}
}
}