#ifndef LEGACY_FLAC
FLAC__StreamEncoderInitStatus init_status;
#endif
- FLAC__StreamMetadata_VorbisComment_Entry vendentry;
- FLAC__StreamMetadata_VorbisComment_Entry commentry;
FLAC_ctx *ctx;
}
#endif
- metadata[num_metadata] = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
- if (metadata[num_metadata]) {
- const char *vendor_string = "Encoded with Timidity++";
- /* Location=output_name */
- memset(&commentry, 0, sizeof(commentry));
- FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&commentry, "LOCATION", comment);
- FLAC__metadata_object_vorbiscomment_append_comment(metadata[num_metadata], commentry, false);
- /* Comment=vendor_string */
- memset(&vendentry, 0, sizeof(vendentry));
- FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&vendentry, "COMMENT", vendor_string);
- FLAC__metadata_object_vorbiscomment_append_comment(metadata[num_metadata], vendentry, false);
- num_metadata++;
- }
-
if (0 < flac_options.padding) {
metadata[num_metadata] = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING);
if (metadata[num_metadata]) {
#if !defined ( IA_W32GUI ) && !defined ( IA_W32G_SYN )
int bitrate;
#endif
- int location_commented = 0;
int title_commented = 0;
#ifdef AU_VORBIS_DLL
if(strcmp(fname, "-") == 0) {
fd = 1; /* data to stdout */
- if(comment == NULL)
- comment = "(stdout)";
} else {
/* Open the audio file */
fd = open(fname, FILE_UPDATE_MODE);
fname, strerror(errno));
return -1;
}
- if(comment == NULL)
- comment = fname;
}
has_loopinfo = 0;
VorbisCommentInfo *info = ogg_vorbis_comment_list;
while (info) {
- if (strcmp(info->tag, "LOCATION") == 0)
- location_commented = 1;
if (strcmp(info->tag, "TITLE") == 0)
title_commented = 1;
}
}
- if (!location_commented)
- {
- /* add a comment */
- char *location_string;
-
- location_string =
- (char *)safe_malloc(strlen(comment) + sizeof("LOCATION=") + 2);
- strcpy(location_string, "LOCATION=");
- strcat(location_string, comment);
-#if defined(__W32__) && (defined(VORBIS_DLL_UNICODE) && (defined(_UNICODE) || defined(UNICODE)))
- {
- char* location_string_utf8 = w32_mbs_to_utf8 ( location_string );
- if ( location_string_utf8 == NULL ) {
- vorbis_comment_add(&vc, (char *)location_string);
- } else {
- vorbis_comment_add(&vc, (char *)location_string_utf8);
- if ( location_string_utf8 != location_string )
- free ( location_string_utf8 );
- }
- free(location_string);
- }
-#else
- vorbis_comment_add(&vc, (char *)location_string);
- free(location_string);
-#endif
- }
-
if (tag_title != NULL && !title_commented) {
/* add default tag */
-#if defined(__W32__) && (defined(VORBIS_DLL_UNICODE) && (defined(_UNICODE) || defined(UNICODE)))
+#if defined(__W32__) && !(defined(_UNICODE) || defined(UNICODE))
{
char* tag_title_utf8 = w32_mbs_to_utf8 ( tag_title );
if ( tag_title_utf8 == NULL ) {