} 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");
} 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");
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) {
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;
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 {
} 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");