[FFmpeg-cvslog] lavd/v4l2: use avcodec_find_decoder in list_formats

Stephan Hilb git at videolan.org
Mon Jan 28 00:15:56 CET 2013


ffmpeg | branch: master | Stephan Hilb <stephan at ecshi.net> | Sun Jan 27 12:17:39 2013 +0100| [0501d0646849c34bdd09802fbe244626b81203b2] | committer: Stefano Sabatini

lavd/v4l2: use avcodec_find_decoder in list_formats

Because libavdevice/v4l2 is a demuxer, it makes sense to look for
decoders instead of encoders when listing the formats supported by the
device.

Signed-off-by: Stefano Sabatini <stefasab at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0501d0646849c34bdd09802fbe244626b81203b2
---

 libavdevice/v4l2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index f6b72bd..5f01027 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -360,7 +360,7 @@ static void list_formats(AVFormatContext *ctx, int fd, int type)
                    vfd.description);
         } else if (vfd.flags & V4L2_FMT_FLAG_COMPRESSED &&
                    type & V4L_COMPFORMATS) {
-            AVCodec *codec = avcodec_find_encoder(codec_id);
+            AVCodec *codec = avcodec_find_decoder(codec_id);
             av_log(ctx, AV_LOG_INFO, "Compressed: %9s : %20s :",
                    codec ? codec->name : "Unsupported",
                    vfd.description);



More information about the ffmpeg-cvslog mailing list