History

Exit ffmpeg if swr_convert() fails.

Carl Eugen Hoyos committed 14 years ago

Commit 7b4e1461 parent a4c22e32 files · +5 −1Browse files

Unified · Split

2 files
  1. ffmpeg.c +4 −0
  2. libswresample/swresample.h +1 −1
ffmpeg.c+4−0
@@ -1267,6 +1267,10 @@ need_realloc: · 1266 unmodified lines
12671267 buftmp = audio_buf;
12681268 size_out = swr_convert(ost->swr, ( uint8_t*[]){buftmp}, audio_buf_size / (enc->channels * osize),
12691269 (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+ }
12701274 size_out = size_out * enc->channels * osize;
12711275 } else {
12721276 buftmp = buf;
libswresample/swresample.h+1−1
@@ -106,7 +106,7 @@ void swr_free(struct SwrContext **s); · 105 unmodified lines
106106 * @param in input buffers, only the first one need to be set in case of packed audio
107107 * @param in_count number of input samples available in one channel
108108 *
109− * @return number of samples output per channel
109+ * @return number of samples output per channel, negative value on error
110110 */
111111 int swr_convert(struct SwrContext *s, uint8_t *out[SWR_CH_MAX], int out_count,
112112 const uint8_t *in [SWR_CH_MAX], int in_count);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t