]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10020: [mod_av] Error scrolls endlessly on a recording that fails to rtmp addrs...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 8 Feb 2017 19:54:38 +0000 (13:54 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 8 Feb 2017 19:54:44 +0000 (13:54 -0600)
src/mod/applications/mod_av/avformat.c

index 23bc269445795a97eff1b4e5452ec3284e7f0e11..8e2f72041dd89394f4c4ee0a0c9ca7a9dc0be107 100644 (file)
@@ -1285,6 +1285,7 @@ struct av_file_context {
        switch_time_t last_vid_push;
        int64_t seek_ts;
        switch_bool_t read_paused;
+       int errs;
 };
 
 typedef struct av_file_context av_file_context_t;
@@ -1984,7 +1985,15 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s
                        if (context->mutex) switch_mutex_unlock(context->mutex);
                        if (ret < 0) {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error while writing audio frame: %s\n", get_error_text(ret));
+                               context->errs++;
                                //switch_goto_status(SWITCH_STATUS_FALSE, end);
+                       } else {
+                               context->errs = 0;
+                       }
+
+                       if (context->errs > 100) {
+                               status = SWITCH_STATUS_FALSE;
+                               break;
                        }
                }
                if (data) {