Browse Source

doc/examples/muxing: Remove unnecessary ret

Remove unnecessary ret and make the code more compact

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Jun Zhao 2 years ago
parent
commit
3497362be1
1 changed files with 1 additions and 4 deletions
  1. 1 4
      doc/examples/muxing.c

+ 1 - 4
doc/examples/muxing.c

@@ -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);
         }