]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_av] reduce some errors to warnings in logs
authorMike Jerris <mike@signalwire.com>
Fri, 17 Apr 2020 16:18:28 +0000 (10:18 -0600)
committerAndrey Volk <andywolk@gmail.com>
Wed, 6 May 2020 23:08:42 +0000 (03:08 +0400)
src/mod/applications/mod_av/avformat.c

index 27c10bf5116196cff8ddc7ec63454d47e3339be4..b76fd599bce7c453e1e8c60b2b6581f64bff1d56 100644 (file)
@@ -1113,7 +1113,7 @@ static switch_status_t open_input_file(av_file_context_t *context, switch_file_h
        /** Open the input file to read from it. */
        if ((error = avformat_open_input(&context->fc, filename, NULL, NULL)) < 0) {
                char ebuf[255] = "";
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not open input file '%s' (error '%s')\n", filename, get_error_text(error, ebuf, sizeof(ebuf)));
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Could not open input file '%s' (error '%s')\n", filename, get_error_text(error, ebuf, sizeof(ebuf)));
                switch_goto_status(SWITCH_STATUS_FALSE, err);
        }
 
@@ -1123,7 +1123,7 @@ static switch_status_t open_input_file(av_file_context_t *context, switch_file_h
        /** Get information on the input file (number of streams etc.). */
        if ((error = avformat_find_stream_info(context->fc, opts ? &opts : NULL)) < 0) {
                char ebuf[255] = "";
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not open find stream info (error '%s')\n", get_error_text(error, ebuf, sizeof(ebuf)));
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Could not open find stream info (error '%s')\n", get_error_text(error, ebuf, sizeof(ebuf)));
                if (opts) av_dict_free(&opts);
                switch_goto_status(SWITCH_STATUS_FALSE, err);
        }
@@ -1194,7 +1194,7 @@ GCC_DIAG_ON(deprecated-declarations)
        // printf("has audio:%d has_video:%d\n", context->has_audio, context->has_video);
 
        if ((!context->has_audio) && (!context->has_video)) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Neither audio nor video stream found in file %s\n", filename);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Neither audio nor video stream found in file %s\n", filename);
                switch_goto_status(SWITCH_STATUS_FALSE, err);
        }
 
@@ -1378,7 +1378,7 @@ GCC_DIAG_ON(deprecated-declarations)
                                pkt.stream_index = context->video_st.st->index;
                        } else {
                                char ebuf[255] = "";
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not read frame (error '%s')\n", get_error_text(error, ebuf, sizeof(ebuf)));
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Could not read frame (error '%s')\n", get_error_text(error, ebuf, sizeof(ebuf)));
                                break;
                        }
                }
@@ -1400,7 +1400,7 @@ GCC_DIAG_OFF(deprecated-declarations)
                        if ((error = avcodec_decode_video2(context->video_st.st->codec, vframe, &got_data, &pkt)) < 0) {
 GCC_DIAG_ON(deprecated-declarations)
                                char ebuf[255] = "";
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not decode frame (error '%s')\n", get_error_text(error, ebuf, sizeof(ebuf)));
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Could not decode frame (error '%s')\n", get_error_text(error, ebuf, sizeof(ebuf)));
                                av_packet_unref(&pkt);
                                av_frame_free(&vframe);
                                break;