On Wed, 25 May 2011 17:52:57 +0200, Stefano Sabatini 
<stefano.sabatini-l...@poste.it> wrote:
> On date Wednesday 2011-05-25 16:27:33 +0200, Anton Khirnov encoded:
> > ---
> >  libavdevice/libdc1394.c |    9 ++++++++-
> >  1 files changed, 8 insertions(+), 1 deletions(-)
> > 
> > diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
> > index f0a7d25..4cbed6e 100644
> > --- a/libavdevice/libdc1394.c
> > +++ b/libavdevice/libdc1394.c
> > @@ -24,6 +24,7 @@
> >  #include "libavformat/avformat.h"
> >  #include "libavutil/log.h"
> >  #include "libavutil/opt.h"
> > +#include "libavutil/pixdesc.h"
> >  
> >  #if HAVE_LIBDC1394_2
> >  #include <dc1394/dc1394.h>
> > @@ -61,6 +62,7 @@ typedef struct dc1394_data {
> >      int fps;
> >  
> >      int width, height;
> > +    char *pix_fmt;
> >  
> >      AVPacket packet;
> >  } dc1394_data;
> > @@ -99,14 +101,18 @@ static inline int dc1394_read_common(AVFormatContext 
> > *c, AVFormatParameters *ap,
> >      AVStream* vst;
> >      struct dc1394_frame_format *fmt;
> >      struct dc1394_frame_rate *fps;
> > -    enum PixelFormat pix_fmt = ap->pix_fmt == PIX_FMT_NONE ? 
> > PIX_FMT_UYVY422 : ap->pix_fmt; /* defaults */
> >      int frame_rate           = !ap->time_base.num ? 30000 : 
> > av_rescale(1000, ap->time_base.den, ap->time_base.num);
> > +    enum PixelFormat pix_fmt = av_get_pix_fmt(dc1394->pix_fmt);
> 
> Possibly a check should be done in case pix_fmt is invalid.

No point in it, since a loop comparing pix_fmt with all allowed formats
follows.

--
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to