[vlc-commits] RTP: cosmetic fixes

Rémi Denis-Courmont git at videolan.org
Fri Nov 4 17:10:42 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov  4 17:44:16 2011 +0200| [3c5962b1991a2c09ef9d0b74975275dbd1cf8955] | committer: Rémi Denis-Courmont

RTP: cosmetic fixes

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

 modules/access/rtp/rtp.c |   31 +++++++++++++------------------
 1 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index 989dec0..c6fea43 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -690,20 +690,22 @@ int rtp_autodetect (demux_t *demux, rtp_session_t *session,
         /*
          * If the rtp payload type is unknown then check demux if it is specified
          */
-        if ((strcmp(demux->psz_demux, "h264") == 0) || (strcmp(demux->psz_demux, "ts") == 0))
+        if (!strcmp(demux->psz_demux, "h264")
+         || !strcmp(demux->psz_demux, "ts"))
         {
-          msg_Dbg (demux, "rtp autodetect specified demux=%s", demux->psz_demux);
-          pt.init = demux_init;
-          pt.destroy = stream_destroy;
-          pt.decode = stream_decode;
-          pt.frequency = 90000;
-          break;
+            msg_Dbg (demux, "dynamic payload format %s specified by demux",
+                     demux->psz_demux);
+            pt.init = demux_init;
+            pt.destroy = stream_destroy;
+            pt.decode = stream_decode;
+            pt.frequency = 90000;
+            break;
         }
-        else if (ptype >= 96)
+        if (ptype >= 96)
         {
             char *dynamic = var_InheritString(demux, "rtp-dynamic-pt");
             if (dynamic == NULL)
-                return -1;
+                ;
             else if (!strcmp(dynamic, "theora"))
             {
                 msg_Dbg (demux, "assuming Theora Encoded Video");
@@ -713,18 +715,11 @@ int rtp_autodetect (demux_t *demux, rtp_session_t *session,
                 pt.frequency = 90000;
             }
             else
-            {
                 msg_Err (demux, "invalid dynamic payload format `%s' "
                                 "specified", dynamic);
-                free(dynamic);
-                return -1;
-            }
-            free(dynamic);
-        }
-        else
-        {
-          return -1;
+            free (dynamic);
         }
+        return -1;
     }
     rtp_add_type (demux, session, &pt);
     return 0;



More information about the vlc-commits mailing list