Commit 345c99c3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Removes invalid UTF-8 byte sequences from meta data as a work-around

until someone who knows how MPEG4 specifies encoding fixes the issue (refs #612)
parent 77439e5c
...@@ -821,35 +821,35 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -821,35 +821,35 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
for( p_0xa9xxx = p_udta->p_first; p_0xa9xxx != NULL; for( p_0xa9xxx = p_udta->p_first; p_0xa9xxx != NULL;
p_0xa9xxx = p_0xa9xxx->p_next ) p_0xa9xxx = p_0xa9xxx->p_next )
{ {
char *psz_utf = strdup( p_0xa9xxx->data.p_0xa9xxx->psz_text );
if( psz_utf == NULL )
continue;
/* FIXME FIXME: should convert from whatever the character
* encoding of MP4 meta data is to UTF-8. */
EnsureUTF8( psz_utf );
switch( p_0xa9xxx->i_type ) switch( p_0xa9xxx->i_type )
{ {
case FOURCC_0xa9nam: /* Full name */ case FOURCC_0xa9nam: /* Full name */
vlc_meta_Add( meta, VLC_META_TITLE, vlc_meta_Add( meta, VLC_META_TITLE, psz_utf );
p_0xa9xxx->data.p_0xa9xxx->psz_text );
break; break;
case FOURCC_0xa9aut: case FOURCC_0xa9aut:
vlc_meta_Add( meta, VLC_META_AUTHOR, vlc_meta_Add( meta, VLC_META_AUTHOR, psz_utf );
p_0xa9xxx->data.p_0xa9xxx->psz_text );
break; break;
case FOURCC_0xa9ART: case FOURCC_0xa9ART:
vlc_meta_Add( meta, VLC_META_ARTIST, vlc_meta_Add( meta, VLC_META_ARTIST, psz_utf );
p_0xa9xxx->data.p_0xa9xxx->psz_text );
break; break;
case FOURCC_0xa9cpy: case FOURCC_0xa9cpy:
vlc_meta_Add( meta, VLC_META_COPYRIGHT, vlc_meta_Add( meta, VLC_META_COPYRIGHT, psz_utf );
p_0xa9xxx->data.p_0xa9xxx->psz_text );
break; break;
case FOURCC_0xa9day: /* Creation Date */ case FOURCC_0xa9day: /* Creation Date */
vlc_meta_Add( meta, VLC_META_DATE, vlc_meta_Add( meta, VLC_META_DATE, psz_utf );
p_0xa9xxx->data.p_0xa9xxx->psz_text );
break; break;
case FOURCC_0xa9des: /* Description */ case FOURCC_0xa9des: /* Description */
vlc_meta_Add( meta, VLC_META_DESCRIPTION, vlc_meta_Add( meta, VLC_META_DESCRIPTION, psz_utf );
p_0xa9xxx->data.p_0xa9xxx->psz_text );
break; break;
case FOURCC_0xa9gen: /* Genre */ case FOURCC_0xa9gen: /* Genre */
vlc_meta_Add( meta, VLC_META_GENRE, vlc_meta_Add( meta, VLC_META_GENRE, psz_utf );
p_0xa9xxx->data.p_0xa9xxx->psz_text );
break; break;
case FOURCC_0xa9swr: case FOURCC_0xa9swr:
...@@ -878,6 +878,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -878,6 +878,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
default: default:
break; break;
} }
free( psz_utf );
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment