[FFmpeg-devel] [PATCH 1/3] lavf/gif: simplify streams type checking.

Clément Bœsch ubitux at gmail.com
Thu Apr 18 13:46:30 CEST 2013


On Thu, Apr 18, 2013 at 11:33:03AM +0000, Paul B Mahol wrote:
> On 4/18/13, Clement Boesch <ubitux at gmail.com> wrote:
> > ---
> >  libavformat/gif.c | 38 +++++++++++++-------------------------
> >  1 file changed, 13 insertions(+), 25 deletions(-)
> >
> > diff --git a/libavformat/gif.c b/libavformat/gif.c
> > index b4a61f5..10531f9 100644
> > --- a/libavformat/gif.c
> > +++ b/libavformat/gif.c
> > @@ -104,32 +104,23 @@ static int gif_write_header(AVFormatContext *s)
> >  {
> >      GIFContext *gif = s->priv_data;
> >      AVIOContext *pb = s->pb;
> > -    AVCodecContext *enc, *video_enc;
> > -    int i, width, height /*, rate*/;
> > +    AVCodecContext *video_enc;
> > +    int width, height;
> >      uint32_t palette[AVPALETTE_COUNT];
> >
> > -/* XXX: do we reject audio streams or just ignore them ?
> > - *  if (s->nb_streams > 1)
> > - *      return -1;
> > - */
> > +    if (s->nb_streams != 1 ||
> > +        s->streams[0]->codec->codec_type != AVMEDIA_TYPE_VIDEO) {
> > +        av_log(s, AV_LOG_ERROR,
> > +               "GIF supports only a single video stream.\n");
> 
> Check for codec too. Rest lgtm.
> 

Added and pushed.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130418/9102db93/attachment.asc>


More information about the ffmpeg-devel mailing list