[vlc-commits] mms: let owner handle HTTP redirection (fixes #4631)

Rémi Denis-Courmont git at videolan.org
Sun Dec 20 15:53:52 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 20 16:52:10 2015 +0200| [6b2a31e5eb7b6b656f6a7befd9a8a113e86ff49a] | committer: Rémi Denis-Courmont

mms: let owner handle HTTP redirection (fixes #4631)

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

 modules/access/mms/mmsh.c |   38 ++++++--------------------------------
 1 file changed, 6 insertions(+), 32 deletions(-)

diff --git a/modules/access/mms/mmsh.c b/modules/access/mms/mmsh.c
index f425ddd..73f96ab 100644
--- a/modules/access/mms/mmsh.c
+++ b/modules/access/mms/mmsh.c
@@ -54,7 +54,6 @@ int  MMSHOpen  ( access_t * );
 void MMSHClose ( access_t * );
 
 static block_t *Block( access_t *p_access );
-static ssize_t ReadRedirect( access_t *, uint8_t *, size_t );
 static int  Seek( access_t *, uint64_t );
 static int  Control( access_t *, int, va_list );
 
@@ -151,32 +150,16 @@ int MMSHOpen( access_t *p_access )
         goto error;
 
     /* Handle redirection */
-    if( psz_location && *psz_location )
+    if( psz_location != NULL )
     {
         msg_Dbg( p_access, "redirection to %s", psz_location );
+        p_access->psz_url = psz_location;
 
-        input_thread_t * p_input = p_access->p_input;
-        input_item_t * p_new_loc;
-
-        if( !p_input )
-        {
-            free( psz_location );
-            goto error;
-        }
-        /** \bug we do not autodelete here */
-        p_new_loc = input_item_New( psz_location, psz_location );
-        input_item_t *p_item = input_GetItem( p_input );
-        input_item_PostSubItem( p_item, p_new_loc );
-
-        vlc_gc_decref( p_new_loc );
-
-        free( psz_location );
-
-        p_access->pf_block = NULL;
-        p_access->pf_read = ReadRedirect;
-        return VLC_SUCCESS;
+        vlc_UrlClean( &p_sys->url );
+        vlc_UrlClean( &p_sys->proxy );
+        free( p_sys );
+        return VLC_ACCESS_REDIRECT;
     }
-    free( psz_location );
 
     /* Start playing */
     if( Start( p_access, 0 ) )
@@ -353,15 +336,6 @@ static int Seek( access_t *p_access, uint64_t i_pos )
 }
 
 /*****************************************************************************
- * ReadRedirect:
- *****************************************************************************/
-static ssize_t ReadRedirect( access_t *p_access, uint8_t *p, size_t i_len )
-{
-    VLC_UNUSED(p_access); VLC_UNUSED(p); VLC_UNUSED(i_len);
-    return 0;
-}
-
-/*****************************************************************************
  * Block:
  *****************************************************************************/
 static block_t *Block( access_t *p_access )



More information about the vlc-commits mailing list