Unified · Split
| @@ -1267,6 +1267,10 @@ need_realloc: · 1266 unmodified lines | ||
| 1267 | 1267 | buftmp = audio_buf; |
| 1268 | 1268 | size_out = swr_convert(ost->swr, ( uint8_t*[]){buftmp}, audio_buf_size / (enc->channels * osize), |
| 1269 | 1269 | (const uint8_t*[]){buf }, size / (dec->channels * isize)); |
| 1270 | + if (size_out < 0) { | |
| 1271 | + av_log(NULL, AV_LOG_FATAL, "swr_convert failed\n"); | |
| 1272 | + exit_program(1); | |
| 1273 | + } | |
| 1270 | 1274 | size_out = size_out * enc->channels * osize; |
| 1271 | 1275 | } else { |
| 1272 | 1276 | buftmp = buf; |
| @@ -106,7 +106,7 @@ void swr_free(struct SwrContext **s); · 105 unmodified lines | ||
| 106 | 106 | * @param in input buffers, only the first one need to be set in case of packed audio |
| 107 | 107 | * @param in_count number of input samples available in one channel |
| 108 | 108 | * |
| 109 | − * @return number of samples output per channel | |
| 109 | + * @return number of samples output per channel, negative value on error | |
| 110 | 110 | */ |
| 111 | 111 | int swr_convert(struct SwrContext *s, uint8_t *out[SWR_CH_MAX], int out_count, |
| 112 | 112 | const uint8_t *in [SWR_CH_MAX], int in_count); |