[mod_av] Fix scan-build 14

This commit is contained in:
Jakub Karolczyk 2024-04-26 12:41:07 +00:00
parent d5ad504723
commit ef32d90e91
2 changed files with 4 additions and 7 deletions

View File

@ -1581,7 +1581,6 @@ GCC_DIAG_ON(deprecated-declarations)
} else if (ret == AVERROR(EAGAIN)) {
/* we fully drain all the output in each encode call, so this should not ever happen */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, "Error sending frame to encoder - BUG, should never happen\n");
ret = AVERROR_BUG;
goto error;
} else if (ret < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error sending frame to encoder\n");

View File

@ -1170,7 +1170,6 @@ GCC_DIAG_ON(deprecated-declarations)
} else if (ret == AVERROR(EAGAIN)) {
/* we fully drain all the output in each encode call, so this should not ever happen */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, "Error sending frame to encoder on draining AVERROR_BUG - should never happen\n");
ret = AVERROR_BUG;
goto do_break;
} else if (ret < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, "Error sending frame to encoder on draining\n");
@ -1426,7 +1425,7 @@ static switch_status_t open_input_file(av_file_context_t *context, switch_file_h
av_dump_format(context->fc, 0, filename, 0);
for (i = 0; i< context->fc->nb_streams; i++) {
for (i = 0; i < context->fc->nb_streams; i++) {
enum AVMediaType codec_type = av_get_codec_type(context->fc->streams[i]);
if (codec_type == AVMEDIA_TYPE_AUDIO && context->has_audio < 2 && idx < 2) {
@ -1554,7 +1553,9 @@ static switch_status_t open_input_file(av_file_context_t *context, switch_file_h
if (context->has_audio) {
AVCodecContext *c[2] = { NULL };
c[0] = av_get_codec_context(&context->audio_st[0]);
if (!(c[0] = av_get_codec_context(&context->audio_st[0]))) {
switch_goto_status(SWITCH_STATUS_FALSE, err);
}
if ((cc = av_get_codec_context(&context->audio_st[1]))) {
c[1] = cc;
@ -1568,9 +1569,7 @@ static switch_status_t open_input_file(av_file_context_t *context, switch_file_h
if (c[1]) {
context->audio_st[1].frame = av_frame_alloc();
switch_assert(context->audio_st[1].frame);
}
if (c[0] && c[1]) {
context->audio_st[0].channels = 1;
context->audio_st[1].channels = 1;
} else {
@ -2016,7 +2015,6 @@ GCC_DIAG_ON(deprecated-declarations)
} else if (dret == AVERROR(EAGAIN)) {
/* we fully drain all the output in each decode call, so this should not ever happen */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, "Error sending audio packet to decoder - BUG, should never happen\n");
dret = AVERROR_BUG;
goto do_continue;
} else if (dret < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, "Error sending audio packet to decoder\n");