[FFmpeg-devel] [PATCH] Misc patches for libavdevice/v4l.c
Stefano Sabatini
stefano.sabatini-lala
Fri Dec 26 11:36:36 CET 2008
On date Friday 2008-12-26 00:52:12 +0100, Michael Niedermayer encoded:
> On Wed, Dec 24, 2008 at 03:37:05PM +0100, Stefano Sabatini wrote:
> > Hi, follows a quick description of the patches:
> >
> > * v4l-space-cosmetics.patch: for consistency's sake
>
> ok
Applied.
> [...]
>
> >
> > * v4l-add-missing-ioctl-check.patch: the ioctl may fail
>
> ok
Applied.
> >
> > * v4l-factorize-time-frame.patch: no need to set it in two distinct points
>
> probably ok
Rethinking at it, the av_gettime() in the line:
s->time_frame = av_gettime() * s->time_base.den / s->time_base.num;
will be set in a different point with the patch attached, resulting in
a slightly different value for s->time_frame, I don't think there are
sensible changes with the patch attached, but since the code as it is
isn't broken, I'll drop this one.
> > * v4l-remove-unnecessary-temporary.patch: remove the unnecessary
> > frame_size var, write it directly in the context
>
> ok
Applied.
> >
> > * v4l-move-capture-cap-check.patch: this check should be performed before
> > all the other ones
>
> probably ok
Applied.
> [...]
>
>
> > Index: ffmpeg/libavdevice/v4l.c
> > ===================================================================
> > --- ffmpeg.orig/libavdevice/v4l.c 2008-12-21 23:45:13.000000000 +0100
> > +++ ffmpeg/libavdevice/v4l.c 2008-12-24 13:34:57.000000000 +0100
> > @@ -84,11 +84,6 @@
> > }
> > s->time_base = ap->time_base;
> >
> > - if((unsigned)ap->width > 32767 || (unsigned)ap->height > 32767) {
> > - av_log(s1, AV_LOG_ERROR, "Capture size is out of range: %dx%d\n",
> > - ap->width, ap->height);
> > - return -1;
> > - }
> > s->video_win.width = ap->width;
> > s->video_win.height = ap->height;
> >
> ?
The idea is that this check is useless, since either the VIDIOCSWIN
either the VIDIOCMCAPTURE iotctl will perform a check on the size (but
I don't know where the 32767 value comes from).
Patches attached:
* v4l-add-videocswin-check.patch: add a missing check
* v4l-remove-unnecessary-size-check.patch: a size check, which should
also check for this invalid condition, will be performed later by
the VIDIOCSWIN or the VIDIOCMCAPTURE ioctls
* v4l-vidiocmcapture-errmsg.patch: more consistent with the other
ioctls error messages, no strong opinion on this though.
Regards.
--
FFmpeg = Faboulous & Fiendish Magic Pure Elastic Ghost
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4l-add-videocswin-check.patch
Type: text/x-diff
Size: 599 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081226/b1cc9a9c/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4l-remove-unnecessary-size-check.patch
Type: text/x-diff
Size: 586 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081226/b1cc9a9c/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4l-vidiocmcapture-errmsg.patch
Type: text/x-diff
Size: 697 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081226/b1cc9a9c/attachment-0002.patch>
More information about the ffmpeg-devel
mailing list