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

Michael Niedermayer michael at niedermayer.cc
Tue Mar 27 00:32:29 EEST 2018


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 at 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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180326/1be6ea7d/attachment.sig>


More information about the ffmpeg-devel mailing list