#include <vlc_charset.h>
#include <vlc_strings.h>
+#include <vlc_input.h>
static input_attachment_t* ParseFlacPicture( const uint8_t *p_data, int i_data, int i_attachments, int *i_type )
{
return p_attachment;
}
-static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_data, int i_data,
- int *i_attachments, input_attachment_t ***attachments)
+static inline void vorbis_ParseComment( vlc_meta_t **pp_meta,
+ const uint8_t *p_data, int i_data,
+ int *i_attachments, input_attachment_t ***attachments,
+ int *i_seekpoint, seekpoint_t ***ppp_seekpoint )
{
int n;
int i_comment;
int i_attach = 0;
+ seekpoint_t *sk = NULL;
if( i_data < 8 )
return;
*i_attachments, *attachments, p_attachment );
}
}
+ else if( !strncasecmp(psz_comment, "chapter", strlen("chapter")) )
+ {
+ if( ppp_seekpoint == NULL )
+ continue;
+
+ int i_chapt;
+ if( strstr( psz_comment, "name") && sscanf( psz_comment, "chapter%i=", &i_chapt ) == 1 )
+ {
+ char *p = strchr( psz_comment, '=' );
+ *p++ = '\0';
+ sk->psz_name = strdup( p );
+ }
+ else if( sscanf( psz_comment, "chapter %i=", &i_chapt ) == 1 )
+ {
+ int h, m, s, ms;
+ char *p = strchr( psz_comment, '=' );
+ *p++ = '\0';
+
+ if( sscanf( p, "%d:%d:%d.%d", &h, &m, &s, &ms ) == 4 )
+ {
+ sk = vlc_seekpoint_New();
+ sk->i_time_offset = ((h * 3600 + m * 60 + s) *1000 + ms) * 1000;
+ TAB_APPEND_CAST( (seekpoint_t**), *i_seekpoint, *ppp_seekpoint, sk );
+ }
+ }
+ }
else if( strchr( psz_comment, '=' ) )
{
/* generic (PERFORMER/LICENSE/ORGANIZATION/LOCATION/CONTACT/ISRC,
* undocumented tags and replay gain ) */
char *p = strchr( psz_comment, '=' );
*p++ = '\0';
+
+ for( int i = 0; psz_comment[i]; i++ )
+ if( psz_comment[i] >= 'a' && psz_comment[i] <= 'z' )
+ psz_comment[i] -= 'a' - 'A';
+
vlc_meta_AddExtra( p_meta, psz_comment, p );
}
#undef IF_EXTRACT