]> git.sesse.net Git - vlc/blobdiff - modules/demux/ts.c
taglib: support for id3v2 embedded album art
[vlc] / modules / demux / ts.c
index f706ad3820f2a8ba28131bc81a69d4956c6cd74e..3c372887578b455c1a9e35f7cc63a468a1a7c987 100644 (file)
@@ -412,7 +412,8 @@ static int Open( vlc_object_t *p_this )
     }
     if( i_sync >= TS_PACKET_SIZE_MAX && !b_topfield )
     {
-        if( strcmp( p_demux->psz_demux, "ts" ) ) return VLC_EGENERIC;
+        if( !p_demux->b_force )
+            return VLC_EGENERIC;
         msg_Warn( p_demux, "this does not look like a TS stream, continuing" );
     }
 
@@ -450,7 +451,7 @@ static int Open( vlc_object_t *p_this )
     {
         i_packet_size = TS_PACKET_SIZE_204;
     }
-    else if( !strcmp( p_demux->psz_demux, "ts" ) )
+    else if( p_demux->b_force )
     {
         i_packet_size = TS_PACKET_SIZE_188;
     }
@@ -2593,8 +2594,8 @@ static int EITConvertDuration( uint32_t i_duration )
 #undef CVT_FROM_BCD
 
 /* FIXME same than dvbsi_to_utf8 from dvb access */
-static char *
-EITConvertToUTF8( const unsigned char *psz_instring, size_t i_length )
+static char *EITConvertToUTF8( const unsigned char *psz_instring,
+                               size_t i_length )
 {
     const char *psz_encoding;
     char *psz_outstring;
@@ -2691,13 +2692,13 @@ EITConvertToUTF8( const unsigned char *psz_instring, size_t i_length )
     if( iconv_handle == (vlc_iconv_t)(-1) )
     {
          /* Invalid character set (e.g. ISO_8859-12) */
-         memcpy( psz_outstring, psz_instring, i_in );
+         memcpy( psz_outstring, &psz_instring[offset], i_in );
          psz_outstring[i_in] = '\0';
          EnsureUTF8( psz_outstring );
     }
     else
     {
-        const char *psz_in = (const char *)psz_instring;
+        const char *psz_in = (const char *)&psz_instring[offset];
         char *psz_out = psz_outstring;
 
         while( vlc_iconv( iconv_handle, &psz_in, &i_in,