# HG changeset patch # User Eugene Zagidullin # Date 1196905154 -10800 # Node ID a13b8f308dce5a0a596ea726637c5c24e9f3c1b6 # Parent 2a13a038987c33b70beee7813c09ae0c88e90e60 vorbis: mimetype field added. also little fix diff -r 2a13a038987c -r a13b8f308dce src/vorbis/vorbis.c --- a/src/vorbis/vorbis.c Thu Dec 06 03:54:59 2007 +0300 +++ b/src/vorbis/vorbis.c Thu Dec 06 04:39:14 2007 +0300 @@ -620,7 +620,7 @@ VFSVorbisFile *vfd = (VFSVorbisFile *) vorbisfile->datasource; Tuple *tuple = NULL; gint length; - vorbis_comment *comment; + vorbis_comment *comment = NULL; tuple = aud_tuple_new_from_filename(filename); @@ -645,18 +645,20 @@ if ((tmps = vorbis_comment_query(comment, "tracknumber", 0)) != NULL) aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi(tmps)); + } - aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossy"); + aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossy"); - if (comment && comment->vendor) - { - gchar *codec = g_strdup_printf("Ogg Vorbis [%s]", comment->vendor); - aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, codec); - g_free(codec); - } - else - aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "Ogg Vorbis"); + if (comment && comment->vendor) + { + gchar *codec = g_strdup_printf("Ogg Vorbis [%s]", comment->vendor); + aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, codec); + g_free(codec); } + else + aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "Ogg Vorbis"); + + aud_tuple_associate_string(tuple, FIELD_MIMETYPE, NULL, "application/ogg"); return tuple; }