[FFmpeg-devel] [FFmpeg-cvslog] lavf/segafilmenc: Do not mix variable declaration and code.

Kyle Swanson k at ylo.ph
Tue Apr 10 02:09:50 EEST 2018


On Mon, Apr 9, 2018 at 3:50 PM, Carl Eugen Hoyos <git at videolan.org> wrote:

> ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Tue Apr
> 10 00:50:01 2018 +0200| [4d1d7263d8ff32e67710b41f24fe485818c87211] |
> committer: Carl Eugen Hoyos
>
> lavf/segafilmenc: Do not mix variable declaration and code.
>
> Fixes two warnings: ISO C90 forbids mixed declarations and code
>
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=
> 4d1d7263d8ff32e67710b41f24fe485818c87211
> ---
>
>  libavformat/segafilmenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/segafilmenc.c b/libavformat/segafilmenc.c
> index 86c0ab0d1c..5b0d7e69e8 100644
> --- a/libavformat/segafilmenc.c
> +++ b/libavformat/segafilmenc.c
> @@ -121,12 +121,12 @@ static int film_write_packet(AVFormatContext
> *format_context, AVPacket *pkt)
>          if (encoded_buf_size != pkt->size && (pkt->size %
> encoded_buf_size) != 0) {
>              avio_write(pb, pkt->data, pkt->size);
>          } else {
> +            uint8_t padding[2] = {0, 0};
>              /* In Sega Cinepak, the reported size in the Cinepak header is
>               * 8 bytes too short. However, the size in the STAB section
> of the header
>               * is correct, taking into account the extra two bytes. */
>              AV_WB24(&pkt->data[1], pkt->size - 8 + 2);
>              metadata->size += 2;
> -            uint8_t padding[2] = {0, 0};
>
>              avio_write(pb, pkt->data, 10);
>              avio_write(pb, padding, 2);
> @@ -158,6 +158,7 @@ static int get_audio_codec_id(enum AVCodecID codec_id)
>
>  static int film_init(AVFormatContext *format_context)
>  {
> +    AVStream *audio = NULL;
>      FILMOutputContext *film = format_context->priv_data;
>      film->audio_index = -1;
>      film->video_index = -1;
> @@ -165,7 +166,6 @@ static int film_init(AVFormatContext *format_context)
>      film->packet_count = 0;
>      film->start = NULL;
>      film->last = NULL;
> -    AVStream *audio = NULL;
>
>      for (int i = 0; i < format_context->nb_streams; i++) {
>          AVStream *st = format_context->streams[i];
>
> _______________________________________________
> ffmpeg-cvslog mailing list
> ffmpeg-cvslog at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


lgtm


More information about the ffmpeg-devel mailing list