[vlc-commits] Do not treat RMF files named .ram as playlists

Jean-Baptiste Kempf git at videolan.org
Thu Mar 22 18:03:37 CET 2012


vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Mar 22 12:06:10 2012 +0100| [ec6a910f5ae00872ba4c7b8414e90d6cbf76306c] | committer: Jean-Baptiste Kempf

Do not treat RMF files named .ram as playlists

Close #6451
(cherry picked from commit ef790e3727fbec13e8a7fd09122581e2ae92b6b5)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/playlist/ram.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/demux/playlist/ram.c b/modules/demux/playlist/ram.c
index 0ed3772..dab0202 100644
--- a/modules/demux/playlist/ram.c
+++ b/modules/demux/playlist/ram.c
@@ -76,11 +76,20 @@ static void ParseClipInfo( const char * psz_clipinfo, char **ppsz_artist, char *
 int Import_RAM( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
+    const uint8_t *p_peek;
 
     if(! demux_IsPathExtension( p_demux, ".ram" ) ||
          demux_IsPathExtension( p_demux, ".rm" ) )
         return VLC_EGENERIC;
 
+    /* Many Real Media Files are misdetected */
+    if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 )
+        return VLC_EGENERIC;
+    if( !memcmp( p_peek, ".ra", 3 ) || !memcmp( p_peek, ".RMF", 4 ) )
+    {
+        return VLC_EGENERIC;
+    }
+
     STANDARD_DEMUX_INIT_MSG( "found valid RAM playlist" );
     p_demux->p_sys->psz_prefix = FindPrefix( p_demux );
 



More information about the vlc-commits mailing list