[vlc-devel] [PATCH 48/48] hls: Cosmetics / removing warnings.

Hugo Beauzée-Luyssen beauze.h at gmail.com
Mon Jan 9 16:16:57 CET 2012


---
 modules/stream_filter/httplive.c |   54 ++++++-------------------------------
 1 files changed, 9 insertions(+), 45 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index ce1656b..1f6238e 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -524,40 +524,6 @@ static char *relative_URI(const char *uri, const char *parent_uri)
 }
 
 
-static char *ConstructUrl(vlc_url_t *url)
-{
-    if ((url->psz_protocol == NULL) ||
-        (url->psz_path == NULL))
-        return NULL;
-
-    if (url->i_port <= 0)
-    {
-        if (strncmp(url->psz_protocol, "https", 5) == 0)
-            url->i_port = 443;
-        else
-            url->i_port = 80;
-    }
-
-    char *psz_url = NULL;
-    if (url->psz_password || url->psz_username)
-    {
-        if (asprintf(&psz_url, "%s://%s:%s@%s:%d%s",
-                     url->psz_protocol,
-                     url->psz_username, url->psz_password,
-                     url->psz_host, url->i_port, url->psz_path) < 0)
-            return NULL;
-    }
-    else
-    {
-        if (asprintf(&psz_url, "%s://%s:%d%s",
-                     url->psz_protocol,
-                     url->psz_host, url->i_port, url->psz_path) < 0)
-            return NULL;
-    }
-
-    return psz_url;
-}
-
 static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *duration)
 {
     assert(hls);
@@ -747,7 +713,7 @@ static int parse_Key(stream_t *s, hls_stream_t *hls, char *p_read)
     }
     else if (strncasecmp(attr, "AES-128", 7) == 0)
     {
-        char *value, *uri, *iv, *key_path;
+        char *value, *uri, *iv;
         if (s->p_sys->b_aesmsg == false)
         {
             msg_Info(s, "playback of AES-128 encrypted HTTP Live media detected.");
@@ -1079,8 +1045,6 @@ static int parse_M3U8(stream_t *s, vlc_array_t *streams, uint8_t *buffer, const
 
 static int hls_DownloadSegmentKey(stream_t *s, segment_t *seg)
 {
-    stream_sys_t *p_sys = (stream_sys_t *) s->p_sys;
-    vlc_url_t key_path;
     uint8_t aeskey[32]; /* AES-512 can use up to 32 bytes */
     ssize_t len;
 
@@ -1094,7 +1058,7 @@ static int hls_DownloadSegmentKey(stream_t *s, segment_t *seg)
     len = stream_Read(p_m3u8, aeskey, sizeof(aeskey));
     if (len != AES_BLOCK_SIZE)
     {
-        msg_Err(s, "The AES key loaded doesn't have the right size (%d)", len);
+        msg_Err(s, "The AES key loaded doesn't have the right size (%Zd)", len);
         stream_Delete(p_m3u8);
         return VLC_EGENERIC;
     }
@@ -1381,15 +1345,15 @@ fail:
 
 static void hls_ChooseDefaultStream(stream_sys_t *p_sys)
 {
-    uint64_t current_bw = 0;
-    unsigned int n;
-    unsigned int stream = 0;
+    uint64_t    current_bw = 0;
+    int         n;
+    int         stream = 0;
 
     int count = vlc_array_count(p_sys->hls_stream);
-    for (n = 0; n < count; n++)
+    for ( n = 0; n < count; n++ )
     {
         hls_stream_t *hls = hls_Get(p_sys->hls_stream, n);
-        if (hls && hls->bandwidth > current_bw)
+        if ( hls && hls->bandwidth > current_bw )
         {
             stream = n;
             current_bw = hls->bandwidth;
@@ -1789,7 +1753,7 @@ static ssize_t read_M3U8_from_stream(stream_t *s, uint8_t **buffer)
             if (total_allocated)
                 total_allocated *= 2;
             else
-                total_allocated = __MIN(bytes+1, sizeof(buf));
+                total_allocated = __MIN( bytes + 1, (ssize_t)sizeof( buf ) );
 
             p = realloc_or_free(p, total_allocated);
             if (p == NULL)
@@ -2166,7 +2130,7 @@ static ssize_t hls_Read(stream_t *s, uint8_t *p_read, unsigned int i_read)
             }
             else
             {
-                msg_Dbg(s, "hls_Read() return %d", copied);
+                msg_Dbg(s, "hls_Read() return %Zd", copied);
             }
             break;
         }
-- 
1.7.8.3




More information about the vlc-devel mailing list