+ else
+ {
+ /* try iTune/Quicktime format, rewind to start */
+ p_peek -= 2; i_read += 2;
+ // we are expecting a 'data' box
+ uint32_t i_data_len;
+ uint32_t i_data_tag;
+
+ MP4_GET4BYTES( i_data_len );
+ if( i_data_len > i_read ) i_data_len = i_read;
+ MP4_GETFOURCC( i_data_tag );
+ if( (i_data_len > 0) && (i_data_tag == VLC_FOURCC('d', 'a', 't', 'a')) )
+ {
+ /* data box contains a version/flags field */
+ uint32_t i_version;
+ uint32_t i_reserved;
+ MP4_GET4BYTES( i_version );
+ MP4_GET4BYTES( i_reserved );
+ // version should be 0, flags should be 1 for text, 0 for data
+ if( i_version == 0x00000001 )
+ {
+ // the rest is the text
+ i_data_len -= 12;
+ p_box->data.p_0xa9xxx->psz_text = malloc( i_data_len + 1 );
+
+ memcpy( p_box->data.p_0xa9xxx->psz_text,
+ p_peek, i_data_len );
+ p_box->data.p_0xa9xxx->psz_text[i_data_len] = '\0';
+#ifdef MP4_VERBOSE
+ msg_Dbg( p_stream,
+ "read box: \"%4.4s\" text=`%s'",
+ (char*)&p_box->i_type,
+ p_box->data.p_0xa9xxx->psz_text );
+#endif
+ }
+ else
+ {
+ // TODO: handle data values for ID3 tag values, track num or cover art,etc...
+ }
+ }
+ }