doc/examples/muxing: Remove unnecessary ret

Remove unnecessary ret and make the code more compact

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
Jun Zhao 2022-10-22 10:46:03 +08:00
parent 79508ee523
commit 3497362be1
1 changed files with 1 additions and 4 deletions

View File

@ -219,8 +219,6 @@ static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt,
int sample_rate, int nb_samples)
{
AVFrame *frame = av_frame_alloc();
int ret;
if (!frame) {
fprintf(stderr, "Error allocating an audio frame\n");
exit(1);
@ -232,8 +230,7 @@ static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt,
frame->nb_samples = nb_samples;
if (nb_samples) {
ret = av_frame_get_buffer(frame, 0);
if (ret < 0) {
if (av_frame_get_buffer(frame, 0) < 0) {
fprintf(stderr, "Error allocating an audio buffer\n");
exit(1);
}