diff mbox series

[FFmpeg-devel,1/2] doc/examples/muxing: Remove unnecessary ret

Message ID 20230225152509.3086288-1-mypopydev@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] doc/examples/muxing: Remove unnecessary ret | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Jun Zhao Feb. 25, 2023, 3:25 p.m. UTC
From: Jun Zhao <barryjzhao@tencent.com>

Remove unnecessary ret and make the code more compact

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 doc/examples/muxing.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

mypopy@gmail.com Feb. 25, 2023, 3:28 p.m. UTC | #1
ignore the patch 1-2, send with the wrong branch

On Sat, Feb 25, 2023 at 11:25 PM Jun Zhao <mypopydev@gmail.com> wrote:
>
> From: Jun Zhao <barryjzhao@tencent.com>
>
> Remove unnecessary ret and make the code more compact
>
> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> ---
>  doc/examples/muxing.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
> index 3acb778322..cd997d5431 100644
> --- a/doc/examples/muxing.c
> +++ b/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);
>          }
> --
> 2.25.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index 3acb778322..cd997d5431 100644
--- a/doc/examples/muxing.c
+++ b/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);
         }