[FFmpeg-devel] [PATCH] Added missing break statements

James Almer jamrial at gmail.com
Sun Dec 31 23:45:50 EET 2017


On 12/31/2017 6:34 PM, Aleksa Savic wrote:
> Signed-off-by: Aleksa Savic <savicaleksa83 at gmail.com>
> ---
>  libavcodec/avs.c           | 2 ++
>  libavcodec/mpegvideo_enc.c | 1 +
>  libavformat/aiffdec.c      | 1 +
>  libavformat/lmlm4.c        | 1 +
>  4 files changed, 5 insertions(+)
> 
> diff --git a/libavcodec/avs.c b/libavcodec/avs.c
> index 66724d47b7..fc158c761e 100644
> --- a/libavcodec/avs.c
> +++ b/libavcodec/avs.c
> @@ -99,6 +99,8 @@ avs_decode_frame(AVCodecContext * avctx,
>      case AVS_I_FRAME:
>          p->pict_type = AV_PICTURE_TYPE_I;
>          p->key_frame = 1;
> +        break;
> +
>      case AVS_P_FRAME_3X3:
>          vect_w = 3;
>          vect_h = 3;
> diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
> index f1f4989231..66aa8a6b47 100644
> --- a/libavcodec/mpegvideo_enc.c
> +++ b/libavcodec/mpegvideo_enc.c
> @@ -3046,6 +3046,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
>                      break;
>                  case AV_CODEC_ID_MPEG2VIDEO:
>                      if(s->mb_x==0 && s->mb_y!=0) is_gob_start=1;
> +                    break;
>                  case AV_CODEC_ID_MPEG1VIDEO:
>                      if(s->mb_skip_run) is_gob_start=0;
>                      break;
> diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
> index 99e05c78ec..58350e8cfe 100644
> --- a/libavformat/aiffdec.c
> +++ b/libavformat/aiffdec.c
> @@ -155,6 +155,7 @@ static int get_aiff_header(AVFormatContext *s, int size,
>              break;
>          case AV_CODEC_ID_ADPCM_G726LE:
>              par->bits_per_coded_sample = 5;
> +            break;
>          case AV_CODEC_ID_ADPCM_IMA_WS:
>          case AV_CODEC_ID_ADPCM_G722:
>          case AV_CODEC_ID_MACE6:
> diff --git a/libavformat/lmlm4.c b/libavformat/lmlm4.c
> index d0cf8feb03..67d44e9962 100644
> --- a/libavformat/lmlm4.c
> +++ b/libavformat/lmlm4.c
> @@ -109,6 +109,7 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt)
>      switch (frame_type) {
>      case LMLM4_I_FRAME:
>          pkt->flags = AV_PKT_FLAG_KEY;
> +        break;
>      case LMLM4_P_FRAME:
>      case LMLM4_B_FRAME:
>          pkt->stream_index = 0;

Have you actually encountered an issue with any of these while decoding,
encoding or demuxing? Because I'm fairly sure most if not all are like
this on purpose.

If what you noticed were warnings from your compiler, then first analyze
each of the above cases and see if falling through is indeed the
intended behavior, and then add such a hint instead to silence the
compiler warnings.


More information about the ffmpeg-devel mailing list