Revision 0dfea024 libavcodec/libgsm.c

View differences:

libavcodec/libgsm.c
49 49
        if(!avctx->sample_rate)
50 50
            avctx->sample_rate= 8000;
51 51
    }else{
52
    if (avctx->sample_rate != 8000) {
53
        av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
54
               avctx->sample_rate);
55
        if(avctx->strict_std_compliance > FF_COMPLIANCE_INOFFICIAL)
56
        return -1;
57
    }
58
    if (avctx->bit_rate != 13000 /* Official */ &&
59
        avctx->bit_rate != 13200 /* Very common */ &&
60
        avctx->bit_rate != 0 /* Unknown; a.o. mov does not set bitrate when decoding */ ) {
61
        av_log(avctx, AV_LOG_ERROR, "Bitrate 13000bps required for GSM, got %dbps\n",
62
               avctx->bit_rate);
63
        if(avctx->strict_std_compliance > FF_COMPLIANCE_INOFFICIAL)
64
        return -1;
65
    }
52
        if (avctx->sample_rate != 8000) {
53
            av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
54
                avctx->sample_rate);
55
            if(avctx->strict_std_compliance > FF_COMPLIANCE_INOFFICIAL)
56
                return -1;
57
        }
58
        if (avctx->bit_rate != 13000 /* Official */ &&
59
            avctx->bit_rate != 13200 /* Very common */ &&
60
            avctx->bit_rate != 0 /* Unknown; a.o. mov does not set bitrate when decoding */ ) {
61
            av_log(avctx, AV_LOG_ERROR, "Bitrate 13000bps required for GSM, got %dbps\n",
62
                avctx->bit_rate);
63
            if(avctx->strict_std_compliance > FF_COMPLIANCE_INOFFICIAL)
64
                return -1;
65
        }
66 66
    }
67 67

  
68 68
    avctx->priv_data = gsm_create();

Also available in: Unified diff