- for (i = 0; i < 9; i++) {
- mp4ff_read_int32(f); /* matrix */
- }
- /* preview_time */ mp4ff_read_int32(f);
- /* preview_duration */ mp4ff_read_int32(f);
- /* poster_time */ mp4ff_read_int32(f);
- /* selection_time */ mp4ff_read_int32(f);
- /* selection_duration */ mp4ff_read_int32(f);
- /* current_time */ mp4ff_read_int32(f);
- /* next_track_id */ mp4ff_read_int32(f);
-
- return 0;
-}
-
-static int32_t mp4ff_tag_add_field(mp4ff_metadata_t * tags, const char *item,
- const char *value, int32_t len)
-{
- void *backup = (void *) tags->tags;
-
- if (!item || (item && !*item) || !value)
- return 0;
-
- tags->tags = (mp4ff_tag_t *) realloc(tags->tags,
- (tags->count + 1) * sizeof (mp4ff_tag_t));
- if (!tags->tags) {
- if (backup)
- free(backup);
- return 0;
- } else {
- tags->tags[tags->count].item = strdup(item);
- tags->tags[tags->count].len = len;
- if (len >= 0) {
- tags->tags[tags->count].value = malloc(len + 1);
- if (tags->tags[tags->count].value != NULL) {
- memcpy(tags->tags[tags->count].value, value, len);
- tags->tags[tags->count].value[len] = 0;
- }
- } else {
- tags->tags[tags->count].value = strdup(value);
- }
-
- if (!tags->tags[tags->count].item || !tags->tags[tags->count].value) {
- if (!tags->tags[tags->count].item)
- free(tags->tags[tags->count].item);
- if (!tags->tags[tags->count].value)
- free(tags->tags[tags->count].value);
- tags->tags[tags->count].item = NULL;
- tags->tags[tags->count].value = NULL;
- tags->tags[tags->count].len = 0;
- return 0;
- }
-
- tags->count++;
- return 1;
- }
-}
-
-static const char *ID3v1GenreList[] = {
- "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk",
- "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies",
- "Other", "Pop", "R&B", "Rap", "Reggae", "Rock",
- "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks",
- "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal",
- "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", "Acid",
- "House", "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass",
- "Soul", "Punk", "Space", "Meditative", "Instrumental Pop",
- "Instrumental Rock", "Ethnic", "Gothic", "Darkwave",
- "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream",
- "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40",
- "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret",
- "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi",
- "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical",
- "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk",
- "Swing", "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic",
- "Bluegrass", "Avantgarde", "Gothic Rock", "Progressive Rock",
- "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band",
- "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson",
- "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus",
- "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba",
- "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle",
- "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House",
- "Dance Hall", "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror",
- "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat",
- "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover",
- "Contemporary C", "Christian Rock", "Merengue", "Salsa", "Thrash Metal",
- "Anime", "JPop", "SynthPop",
-};
-
-static const char *mp4ff_meta_index_to_genre(uint32_t idx)
-{
- if (idx > 0 && idx <= sizeof (ID3v1GenreList) / sizeof (ID3v1GenreList[0])) {
- return ID3v1GenreList[idx - 1];
- } else {
- return 0;
- }
-}
-
-static char *mp4ff_read_string(mp4ff_t * f, uint32_t length)
-{
- char *str = (char *) malloc(length + 1);
- if (str != 0) {
- if ((uint32_t) mp4ff_read_data(f, str, length) != length) {
- free(str);
- str = 0;
- } else {
- str[length] = 0;
- }
- }
- return str;