[FFmpeg-devel,v2] avdevice/v4l2: Remove av_assert0 when format not supported

Submitted by Andriy Gelman on Nov. 4, 2019, 12:57 a.m.

Details

Message ID 20191104005723.31954-1-andriy.gelman@gmail.com
State New
Headers show

Commit Message

Andriy Gelman Nov. 4, 2019, 12:57 a.m.
From: Andriy Gelman <andriy.gelman@gmail.com>

This commit removes an av_assert0 which signals an abort when a v4l2 device
does not support a target format.

For example:
./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts -
will currently signal an abort if /dev/video0 does not support h264.
The new behaviour is to return an AVERROR(EINVAL) error code.

Fixes #6629

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
---
 libavdevice/v4l2.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Nicolas George Nov. 4, 2019, 11:54 a.m.
Andriy Gelman (12019-11-03):
> The new behaviour is to return an AVERROR(EINVAL) error code.

This is not obvious in the code at all: please check it with an
av_assert0().

Regards,

Patch hide | download patch | download mbox

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 446a243cf8..a6ba015a86 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -811,7 +811,6 @@  static int device_try_init(AVFormatContext *ctx,
     }
 
     *codec_id = ff_fmt_v4l2codec(*desired_format);
-    av_assert0(*codec_id != AV_CODEC_ID_NONE);
     return ret;
 }