Revision 900a129f libavcodec/libopencore-amr.c

View differences:

libavcodec/libopencore-amr.c
92 92

  
93 93
    if (avctx->channels > 1) {
94 94
        av_log(avctx, AV_LOG_ERROR, "amr_nb: multichannel decoding not supported\n");
95
        return -1;
95
        return AVERROR(ENOSYS);
96 96
    }
97 97

  
98 98
    return 0;
......
126 126
    if (packet_size > buf_size) {
127 127
        av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
128 128
               buf_size, packet_size);
129
        return -1;
129
        return AVERROR_INVALIDDATA;
130 130
    }
131 131

  
132 132
    s->frameCount++;
......
159 159

  
160 160
    if (avctx->sample_rate != 8000) {
161 161
        av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
162
        return -1;
162
        return AVERROR(ENOSYS);
163 163
    }
164 164

  
165 165
    if (avctx->channels != 1) {
166 166
        av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
167
        return -1;
167
        return AVERROR(ENOSYS);
168 168
    }
169 169

  
170 170
    avctx->frame_size  = 160;
......
178 178

  
179 179
    if ((s->enc_bitrate = getBitrateMode(avctx->bit_rate)) < 0) {
180 180
        av_log(avctx, AV_LOG_ERROR, nb_bitrate_unsupported);
181
        return -1;
181
        return AVERROR(ENOSYS);
182 182
    }
183 183

  
184 184
    return 0;
......
202 202

  
203 203
    if ((s->enc_bitrate = getBitrateMode(avctx->bit_rate)) < 0) {
204 204
        av_log(avctx, AV_LOG_ERROR, nb_bitrate_unsupported);
205
        return -1;
205
        return AVERROR(ENOSYS);
206 206
    }
207 207

  
208 208
    written = Encoder_Interface_Encode(s->enstate, s->enc_bitrate, data,
......
250 250

  
251 251
    if (avctx->channels > 1) {
252 252
        av_log(avctx, AV_LOG_ERROR, "amr_wb: multichannel decoding not supported\n");
253
        return -1;
253
        return AVERROR(ENOSYS);
254 254
    }
255 255

  
256 256
    return 0;
......
277 277
    if (packet_size > buf_size) {
278 278
        av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
279 279
               buf_size, packet_size + 1);
280
        return -1;
280
        return AVERROR_INVALIDDATA;
281 281
    }
282 282

  
283 283
    s->frameCount++;

Also available in: Unified diff