X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=ogg_afh.c;h=4b44ea16664948da6cd52adca357b5cb037c3223;hp=11214c8938622023157110f117c1c06a03f89837;hb=7cb8fa26cfdcb3d34f8be2b86c48ffc6d7b9d84a;hpb=7cb521f3eeb7fda02344c523989d5903251e673e diff --git a/ogg_afh.c b/ogg_afh.c index 11214c89..4b44ea16 100644 --- a/ogg_afh.c +++ b/ogg_afh.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Andre Noll + * Copyright (C) 2004-2010 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -9,6 +9,7 @@ #include #include #include +#include #include "para.h" #include "afh.h" @@ -60,7 +61,6 @@ static int read_vorbis_info(ogg_sync_state *oss, struct afh_info *afhi) ogg_stream_state stream; ogg_page page; int ret; - char *taginfo; vorbis_info_init(&vi); vorbis_comment_init(&vc); @@ -93,17 +93,11 @@ static int read_vorbis_info(ogg_sync_state *oss, struct afh_info *afhi) ret = read_vorbis_comment(oss, &stream, &vi, &vc); if (ret < 0) goto out; - taginfo = make_taginfo( - vorbis_comment_query(&vc, "title", 0), - vorbis_comment_query(&vc, "artist", 0), - vorbis_comment_query(&vc, "album", 0), - vorbis_comment_query(&vc, "year", 0), - vorbis_comment_query(&vc, "comment", 0) - ); - PARA_DEBUG_LOG("tag info: %s\n", taginfo); - afhi->info_string = make_message("%s:\n%s", - status_item_list[SI_AUDIO_FILE_INFO], taginfo); - free(taginfo); + afhi->tags.artist = para_strdup(vorbis_comment_query(&vc, "artist", 0)); + afhi->tags.title = para_strdup(vorbis_comment_query(&vc, "title", 0)); + afhi->tags.album = para_strdup(vorbis_comment_query(&vc, "album", 0)); + afhi->tags.year = para_strdup(vorbis_comment_query(&vc, "year", 0)); + afhi->tags.comment = para_strdup(vorbis_comment_query(&vc, "comment", 0)); afhi->header_offset = 0; afhi->header_len = oss->returned; @@ -111,7 +105,7 @@ static int read_vorbis_info(ogg_sync_state *oss, struct afh_info *afhi) out: vorbis_info_clear(&vi); vorbis_comment_clear(&vc); - ogg_stream_clear(&stream); + //ogg_stream_clear(&stream); return ret; } @@ -138,7 +132,6 @@ static int ogg_get_file_info(char *map, size_t numbytes, __a_unused int fd, int ret, i, j, frames_per_chunk, ct_size; long long unsigned num_frames = 0; - afhi->info_string = NULL; ogg_sync_init(&oss); ret = -E_OGG_SYNC; buf = ogg_sync_buffer(&oss, len); @@ -187,7 +180,6 @@ static int ogg_get_file_info(char *map, size_t numbytes, __a_unused int fd, } afhi->chunks_total = j; set_chunk_tv(num_frames, j, afhi->frequency, &afhi->chunk_tv); - tv_scale(3, &afhi->chunk_tv, &afhi->eof_tv); ret = 0; out: ogg_sync_clear(&oss);