Ticket #887: 0001-Patch-for-assertion-error-in-swresample.c.-Fiexes-bu.2.patch

File 0001-Patch-for-assertion-error-in-swresample.c.-Fiexes-bu.2.patch, 1.4 KB (added by Oana Stratulat, 15 years ago)

Patch for this bug.

  • ffmpeg.c

    From 0116428d62cb0f00bb2b72b5505698a282482dcf Mon Sep 17 00:00:00 2001
    From: Oana Stratulat <oanaandreeastratulat@gmail.com>
    Date: Fri, 6 Jan 2012 02:33:23 +0200
    Subject: [PATCH] Patch for assertion error in swresample.c. Fiexes bug 887.
    
    ---
     ffmpeg.c |   10 ++++++++--
     1 files changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/ffmpeg.c b/ffmpeg.c
    index 29442f7..c6b00d5 100644
    a b need_realloc:  
    10961096                av_opt_set_int(ost->swr, "icl", av_get_default_channel_layout(ost->audio_channels_mapped), 0);
    10971097                av_opt_set_int(ost->swr, "uch", ost->audio_channels_mapped, 0);
    10981098            }
    1099             av_opt_set_int(ost->swr, "ich", dec->channels, 0);
    1100             av_opt_set_int(ost->swr, "och", enc->channels, 0);
     1099            if (av_opt_set_int(ost->swr, "ich", dec->channels, 0) < 0) {
     1100                av_log(NULL, AV_LOG_FATAL, "Unsupported number of inputput channels\n");
     1101                exit_program(1);
     1102            }
     1103            if (av_opt_set_int(ost->swr, "och", enc->channels, 0) < 0) {
     1104                av_log(NULL, AV_LOG_FATAL, "Unsupported number of output channels\n");
     1105                exit_program(1);
     1106            }
    11011107            if(audio_sync_method>1) av_opt_set_int(ost->swr, "flags", SWR_FLAG_RESAMPLE, 0);
    11021108            if(ost->swr && swr_init(ost->swr) < 0){
    11031109                av_log(NULL, AV_LOG_FATAL, "swr_init() failed\n");