Re: [FFmpeg-devel] [PATCH v3] avdevice/v4l2: Remove av_assert0 when format not supported
On Wed, Nov 06, 2019 at 11:44:50AM +0100, Nicolas George wrote: > Andriy Gelman (12019-11-04): > > From: Andriy Gelman > > > > Before this commit an av_assert0 would fail if a v4l2 device did not > > support a target format. > > For example, > > ./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts - > > would signal an abort if /dev/video0 did not support h264. > > > > The new behaviour is to return an AVERROR(EINVAL) error code. An > > av_assert0 has been added to verify this return. > > > > Fixes #6629 > > > > Signed-off-by: Andriy Gelman > > --- > > libavdevice/v4l2.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c > > index 446a243cf8..365bacd771 100644 > > --- a/libavdevice/v4l2.c > > +++ b/libavdevice/v4l2.c > > @@ -811,7 +811,8 @@ static int device_try_init(AVFormatContext *ctx, > > } > > > > *codec_id = ff_fmt_v4l2codec(*desired_format); > > -av_assert0(*codec_id != AV_CODEC_ID_NONE); > > +if (*codec_id == AV_CODEC_ID_NONE) > > +av_assert0(ret == AVERROR(EINVAL)); > > return ret; > > } > > > > This version is fine by me, thanks. But I do not maintain this file. will apply thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3] avdevice/v4l2: Remove av_assert0 when format not supported
Andriy Gelman (12019-11-04): > From: Andriy Gelman > > Before this commit an av_assert0 would fail if a v4l2 device did not > support a target format. > For example, > ./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts - > would signal an abort if /dev/video0 did not support h264. > > The new behaviour is to return an AVERROR(EINVAL) error code. An > av_assert0 has been added to verify this return. > > Fixes #6629 > > Signed-off-by: Andriy Gelman > --- > libavdevice/v4l2.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c > index 446a243cf8..365bacd771 100644 > --- a/libavdevice/v4l2.c > +++ b/libavdevice/v4l2.c > @@ -811,7 +811,8 @@ static int device_try_init(AVFormatContext *ctx, > } > > *codec_id = ff_fmt_v4l2codec(*desired_format); > -av_assert0(*codec_id != AV_CODEC_ID_NONE); > +if (*codec_id == AV_CODEC_ID_NONE) > +av_assert0(ret == AVERROR(EINVAL)); > return ret; > } > This version is fine by me, thanks. But I do not maintain this file. Please remember to reply to the list, not personally; it is the default, no need to do anything special if your software works normally. Regards, -- Nicolas George signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v3] avdevice/v4l2: Remove av_assert0 when format not supported
From: Andriy Gelman Before this commit an av_assert0 would fail if a v4l2 device did not support a target format. For example, ./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts - would signal an abort if /dev/video0 did not support h264. The new behaviour is to return an AVERROR(EINVAL) error code. An av_assert0 has been added to verify this return. Fixes #6629 Signed-off-by: Andriy Gelman --- libavdevice/v4l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 446a243cf8..365bacd771 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -811,7 +811,8 @@ static int device_try_init(AVFormatContext *ctx, } *codec_id = ff_fmt_v4l2codec(*desired_format); -av_assert0(*codec_id != AV_CODEC_ID_NONE); +if (*codec_id == AV_CODEC_ID_NONE) +av_assert0(ret == AVERROR(EINVAL)); return ret; } -- 2.23.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".