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

Jean-Baptiste Kempf git at videolan.org
Thu Mar 22 12:07:30 CET 2012


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

Do not treat RMF files named .ram as playlists

Close #6451

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

 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