Skip to content

Commit

Permalink
Merge pull request #1897 from acmay/ffmpeg
Browse files Browse the repository at this point in the history
Check swr_init() error code and exit early.
  • Loading branch information
mikebrady authored Aug 25, 2024
2 parents 8901f02 + 94eda9b commit 92a933a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2364,7 +2364,11 @@ void *rtp_buffered_audio_processor(void *arg) {
};

av_opt_set_sample_fmt(swr, "out_sample_fmt", av_format, 0);
swr_init(swr);
int swr_err = swr_init(swr);
if (swr_err !=0){
die("FFMpeg swr_init() failed Error %d (%s)",
swr_err, av_err2str(swr_err));
}

uint8_t packet[16 * 1024];
unsigned char m[16 * 1024]; // leave the first 7 bytes blank to make room for the ADTS
Expand Down

0 comments on commit 92a933a

Please sign in to comment.