From 8230c927f08870aa24d5cfd9d987ecc3d4b465aa Mon Sep 17 00:00:00 2001 From: Hou Qi Date: Thu, 6 Jul 2023 17:44:48 +0800 Subject: [PATCH] v4l2videodec: correctly register v4l2mpeg2dec Part-of: --- .../sys/v4l2/gstv4l2videodec.c | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c index 6a702fa1e1..1d3b83bd01 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2videodec.c @@ -1384,20 +1384,13 @@ G_STMT_START { \ gint mpegversion = 0; gst_structure_get_int (s, "mpegversion", &mpegversion); - switch (mpegversion) { - /* MPEG 2 decoders supports MPEG 1 format */ - case 1: - case 2: - SET_META ("MPEG2"); - cdata->codec = gst_v4l2_mpeg2_get_codec (); - break; - case 4: - SET_META ("MPEG4"); - cdata->codec = gst_v4l2_mpeg4_get_codec (); - break; - default: - g_warning ("Unsupported MPEG Video version %i", mpegversion); - break; + if (mpegversion == 4) { + SET_META ("MPEG4"); + cdata->codec = gst_v4l2_mpeg4_get_codec (); + } else { + /* MPEG 2 decoders supports MPEG 1 format */ + SET_META ("MPEG2"); + cdata->codec = gst_v4l2_mpeg2_get_codec (); } } else if (gst_structure_has_name (s, "video/x-h263")) { SET_META ("H263");