#include <inttypes.h>
#include <ogg/ogg.h>
#include <vorbis/codec.h>
+#include <regex.h>
#include "para.h"
#include "afh.h"
ogg_stream_state stream;
ogg_page page;
int ret;
- char *taginfo;
vorbis_info_init(&vi);
vorbis_comment_init(&vc);
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;
out:
vorbis_info_clear(&vi);
vorbis_comment_clear(&vc);
- ogg_stream_clear(&stream);
+ //ogg_stream_clear(&stream);
return ret;
}
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);
}
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);