diff mbox series

[FFmpeg-devel,4/7] avcodec/h261dec: Remove pointless goto

Message ID AS8P250MB074435B3D743C9BA7285BD338FC8A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit fc880c70326a9d5ad3f501db5fdf686cf11b60b1
Headers show
Series [FFmpeg-devel,1/7] avcodec/wmv2dec: Parse extradata during init | expand

Commit Message

Andreas Rheinhardt Oct. 7, 2023, 12:40 a.m. UTC
There is no need to parse the header twice; doing so does nothing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/h261dec.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Michael Niedermayer Oct. 8, 2023, 4:40 p.m. UTC | #1
On Sat, Oct 07, 2023 at 02:40:28AM +0200, Andreas Rheinhardt wrote:
> There is no need to parse the header twice; doing so does nothing.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/h261dec.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
> index 91d555a70e..272bbbea34 100644
> --- a/libavcodec/h261dec.c
> +++ b/libavcodec/h261dec.c
> @@ -605,7 +605,6 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
>  
>      h->gob_start_code_skipped = 0;
>  
> -retry:
>      init_get_bits(&s->gb, buf, buf_size * 8);
>  
>      ret = h261_decode_picture_header(h);
> @@ -627,8 +626,6 @@ retry:
>          ret = ff_set_dimensions(avctx, s->width, s->height);
>          if (ret < 0)
>              return ret;
> -
> -        goto retry;

the goto is not pointless, it has a semicolon which includes a point

sorry i could not resist


[...]
diff mbox series

Patch

diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 91d555a70e..272bbbea34 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -605,7 +605,6 @@  static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
 
     h->gob_start_code_skipped = 0;
 
-retry:
     init_get_bits(&s->gb, buf, buf_size * 8);
 
     ret = h261_decode_picture_header(h);
@@ -627,8 +626,6 @@  retry:
         ret = ff_set_dimensions(avctx, s->width, s->height);
         if (ret < 0)
             return ret;
-
-        goto retry;
     }
 
     if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||