[vlc-commits] [Git][videolan/vlc][master] 4 commits: dshow: don't create local variable for chroma

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Dec 3 07:48:21 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c31160af by Steve Lhomme at 2023-12-03T06:27:01+00:00
dshow: don't create local variable for chroma

We never use that variable afterwards.

- - - - -
dce250f6 by Steve Lhomme at 2023-12-03T06:27:01+00:00
rawaud: don't create local variable for audio FourCC

We never use that variable afterwards.

- - - - -
373bd67a by Steve Lhomme at 2023-12-03T06:27:01+00:00
gstreamer: support fourcc strings smaller than 4 chars

It's now supported by vlc_fourcc_GetCodecFromString().

If the string doesn't match any video callback, we use the hardcoded mapping.

- - - - -
f5f2eb80 by Steve Lhomme at 2023-12-03T06:27:01+00:00
demux/image: use NULL for the default chroma string

It's handled by vlc_fourcc_GetCodecFromString() and other string parameters
usually use NULL instead of "".

- - - - -


4 changed files:

- modules/access/dshow/dshow.cpp
- modules/codec/gstreamer/gstvlcpictureplaneallocator.c
- modules/demux/image.c
- modules/demux/rawaud.c


Changes:

=====================================
modules/access/dshow/dshow.cpp
=====================================
@@ -440,7 +440,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
     free( psz_val );
 
     /* Chroma */
-    psz_val = var_CreateGetString( p_this, "dshow-chroma" );
+    psz_val = var_InheritString( p_this, "dshow-chroma" );
     i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_val );
     free( psz_val );
 


=====================================
modules/codec/gstreamer/gstvlcpictureplaneallocator.c
=====================================
@@ -134,18 +134,12 @@ static GstMemory* gst_vlc_picture_plane_copy(
 
 vlc_fourcc_t gst_vlc_to_map_format( const char* psz_fourcc )
 {
-    if( !psz_fourcc )
-        return VLC_CODEC_UNKNOWN;
+    vlc_fourcc_t res = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_fourcc );
 
-    if( strlen( psz_fourcc ) != 4 )
-    {
-        return GetGstVLCFourcc( psz_fourcc );
-    }
-    else
-    {
-        return vlc_fourcc_GetCodecFromString(
-                VIDEO_ES, psz_fourcc );
-    }
+    if( res == 0 )
+        res = GetGstVLCFourcc( psz_fourcc );
+
+    return res;
 }
 
 void gst_vlc_picture_plane_allocator_release(


=====================================
modules/demux/image.c
=====================================
@@ -84,7 +84,7 @@ vlc_module_begin()
         change_safe()
     add_bool("image-decode", true, DECODE_TEXT, DECODE_LONGTEXT)
         change_safe()
-    add_string("image-chroma", "", CHROMA_TEXT, CHROMA_LONGTEXT)
+    add_string("image-chroma", NULL, CHROMA_TEXT, CHROMA_LONGTEXT)
         change_safe()
     add_float("image-duration", 10, DURATION_TEXT, DURATION_LONGTEXT)
         change_safe()


=====================================
modules/demux/rawaud.c
=====================================
@@ -108,7 +108,7 @@ static int Open( vlc_object_t * p_this )
     if( !p_sys )
         return VLC_ENOMEM;
 
-    char *psz_fourcc = var_CreateGetString( p_demux, "rawaud-fourcc" );
+    char *psz_fourcc = var_InheritString( p_demux, "rawaud-fourcc" );
     es_format_Init( &p_sys->fmt, AUDIO_ES,
                     vlc_fourcc_GetCodecFromString( AUDIO_ES, psz_fourcc ) );
     free( psz_fourcc );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7fe0b8e73e3ae6bbbc9003dabb58c7972b20a042...f5f2eb803d6b5cd90219c71dba2a78491ac10650

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7fe0b8e73e3ae6bbbc9003dabb58c7972b20a042...f5f2eb803d6b5cd90219c71dba2a78491ac10650
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list