[vlc-commits] flac: use demux_IsContentType()

Rémi Denis-Courmont git at videolan.org
Sun Dec 20 21:27:24 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 20 20:26:57 2015 +0200| [0ac52736dfcd5c0b0a19a06616b11feec9d3be12] | committer: Rémi Denis-Courmont

flac: use demux_IsContentType()

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

 modules/demux/flac.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/modules/demux/flac.c b/modules/demux/flac.c
index 9221c61..2daab84 100644
--- a/modules/demux/flac.c
+++ b/modules/demux/flac.c
@@ -119,16 +119,9 @@ 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 )
-        {
-            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 );
-        }
+        if( !p_demux->b_force
+         && !demux_IsContentType( p_demux, "audio/flac" ) )
+            return VLC_EGENERIC;
 
         /* User forced */
         msg_Err( p_demux, "this doesn't look like a flac stream, "



More information about the vlc-commits mailing list