[vlc-commits] extractor: avoid one strcmp()

Rémi Denis-Courmont git at videolan.org
Sun Feb 26 15:43:40 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 25 09:48:07 2017 +0200| [427f2e4dc0d60360a3ed5e6a476144315f077729] | committer: Rémi Denis-Courmont

extractor: avoid one strcmp()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=427f2e4dc0d60360a3ed5e6a476144315f077729
---

 src/input/stream_extractor.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/input/stream_extractor.c b/src/input/stream_extractor.c
index 68d76f1..00cf5ee 100644
--- a/src/input/stream_extractor.c
+++ b/src/input/stream_extractor.c
@@ -281,8 +281,9 @@ static int
 StreamExtractorAttach( stream_t** source, char const* identifier,
     char const* module_name )
 {
-    char const* capability = identifier ? "stream_extractor"
-                                        : "stream_directory";
+    const bool extractor = identifier != NULL;
+    char const* capability = extractor ? "stream_extractor"
+                                       : "stream_directory";
 
     struct stream_extractor_private* priv = vlc_custom_create(
         (*source)->obj.parent, sizeof( *priv ), capability );
@@ -290,7 +291,7 @@ StreamExtractorAttach( stream_t** source, char const* identifier,
     if( unlikely( !priv ) )
         return VLC_ENOMEM;
 
-    if( strcmp( capability, "stream_extractor" ) == 0 )
+    if( extractor )
     {
         priv->object = VLC_OBJECT( &priv->extractor );
 



More information about the vlc-commits mailing list