diff mbox

[FFmpeg-devel,2/2] doc/examples/hw_decode: Remove logically dead code in decode_write()

Message ID 20180325182138.9237-2-michael@niedermayer.cc
State Accepted
Commit b3e9f3f5f52d2c769e0cb6ab1676e16c858e19b3
Headers show

Commit Message

Michael Niedermayer March 25, 2018, 6:21 p.m. UTC
Fixes CID1415951

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 doc/examples/hw_decode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jun Zhao March 26, 2018, 12:15 a.m. UTC | #1
On 2018/3/26 2:21, Michael Niedermayer wrote:
> Fixes CID1415951
>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  doc/examples/hw_decode.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/doc/examples/hw_decode.c b/doc/examples/hw_decode.c
> index 74a0ca32db..77ae8df35b 100644
> --- a/doc/examples/hw_decode.c
> +++ b/doc/examples/hw_decode.c
> @@ -86,7 +86,7 @@ static int decode_write(AVCodecContext *avctx, AVPacket *packet)
>          return ret;
>      }
>  
> -    while (ret >= 0) {
> +    while (1) {
>          if (!(frame = av_frame_alloc()) || !(sw_frame = av_frame_alloc())) {
>              fprintf(stderr, "Can not alloc frame\n");
>              ret = AVERROR(ENOMEM);
> @@ -142,8 +142,6 @@ static int decode_write(AVCodecContext *avctx, AVPacket *packet)
>          if (ret < 0)
>              return ret;
>      }
> -
> -    return 0;
>  }
>  
>  int main(int argc, char *argv[])
LGTM both patches
Michael Niedermayer March 26, 2018, 9:32 p.m. UTC | #2
On Mon, Mar 26, 2018 at 08:15:49AM +0800, Jun Zhao wrote:
> 
> 
> On 2018/3/26 2:21, Michael Niedermayer wrote:
> > Fixes CID1415951
> >
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  doc/examples/hw_decode.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/doc/examples/hw_decode.c b/doc/examples/hw_decode.c
> > index 74a0ca32db..77ae8df35b 100644
> > --- a/doc/examples/hw_decode.c
> > +++ b/doc/examples/hw_decode.c
> > @@ -86,7 +86,7 @@ static int decode_write(AVCodecContext *avctx, AVPacket *packet)
> >          return ret;
> >      }
> >  
> > -    while (ret >= 0) {
> > +    while (1) {
> >          if (!(frame = av_frame_alloc()) || !(sw_frame = av_frame_alloc())) {
> >              fprintf(stderr, "Can not alloc frame\n");
> >              ret = AVERROR(ENOMEM);
> > @@ -142,8 +142,6 @@ static int decode_write(AVCodecContext *avctx, AVPacket *packet)
> >          if (ret < 0)
> >              return ret;
> >      }
> > -
> > -    return 0;
> >  }
> >  
> >  int main(int argc, char *argv[])
> LGTM both patches

will apply

thx

[...]
diff mbox

Patch

diff --git a/doc/examples/hw_decode.c b/doc/examples/hw_decode.c
index 74a0ca32db..77ae8df35b 100644
--- a/doc/examples/hw_decode.c
+++ b/doc/examples/hw_decode.c
@@ -86,7 +86,7 @@  static int decode_write(AVCodecContext *avctx, AVPacket *packet)
         return ret;
     }
 
-    while (ret >= 0) {
+    while (1) {
         if (!(frame = av_frame_alloc()) || !(sw_frame = av_frame_alloc())) {
             fprintf(stderr, "Can not alloc frame\n");
             ret = AVERROR(ENOMEM);
@@ -142,8 +142,6 @@  static int decode_write(AVCodecContext *avctx, AVPacket *packet)
         if (ret < 0)
             return ret;
     }
-
-    return 0;
 }
 
 int main(int argc, char *argv[])