[vlc-commits] demux: flac: probe by mime type

Francois Cartegnie git at videolan.org
Thu Apr 24 20:45:12 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 24 20:43:12 2014 +0200| [1a9a0bd53449bd51a00ecf93fcbb05f2ceda5c88] | committer: Francois Cartegnie

demux: flac: probe by mime type

refs #10222

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

 modules/demux/flac.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/demux/flac.c b/modules/demux/flac.c
index ff066d9..0405d2e 100644
--- a/modules/demux/flac.c
+++ b/modules/demux/flac.c
@@ -109,7 +109,16 @@ static int Open( vlc_object_t * p_this )
 
     if( p_peek[0]!='f' || p_peek[1]!='L' || p_peek[2]!='a' || p_peek[3]!='C' )
     {
-        if( !p_demux->b_force ) return VLC_EGENERIC;
+        if( !p_demux->b_force )
+        {
+            char *psz_mime = stream_ContentType( p_demux->s );
+            if ( !psz_mime || strcmp( psz_mime, "audio/flac" ) )
+            {
+                free( psz_mime );
+                return VLC_EGENERIC;
+            }
+            free( psz_mime );
+        }
 
         /* User forced */
         msg_Err( p_demux, "this doesn't look like a flac stream, "



More information about the vlc-commits mailing list