[banshee] [PlaylistParser] Save the HTTP stream directly to the MemoryStream



commit a3aeb41b6e75a389a14f74bc8f30a5cd0e97e547
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sat Jun 13 17:52:03 2009 +0200

    [PlaylistParser] Save the HTTP stream directly to the MemoryStream
    
    This removes the 4 KB limitation for HTTP playlists (BGO#585329).
    Infinity ought to be enough for anybody.

 .../Banshee.Playlists.Formats/PlaylistParser.cs    |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs b/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs
index b876dec..667e197 100644
--- a/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs
+++ b/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs
@@ -91,19 +91,7 @@ namespace Banshee.Playlists.Formats
                     try {
                         stream = new MemoryStream ();
 
-                        byte [] buffer = new byte[4096];
-                        int read;
-            
-                        // If more than 4KB of data exists on an HTTP playlist, 
-                        // it's probably not a playlist. This kind of sucks,
-                        // but it should work until someone can prove otherwise
-                        
-                        read = web_stream.Read (buffer, 0, buffer.Length);
-                        if (read >= buffer.Length - 1) {
-                            throw new InvalidPlaylistException ();
-                        }
-                        
-                        stream.Write (buffer, 0, read);
+                        Banshee.IO.StreamAssist.Save (web_stream, stream, false);
                         stream.Position = 0;
                     } finally {
                         web_stream.Close ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]