Skip to content

Commit

Permalink
Merge branch 'dev41' into unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
starg2 committed Mar 25, 2020
2 parents 38229dc + 97d5747 commit 37f43a5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 52 deletions.
2 changes: 1 addition & 1 deletion interface/w32g_i.c
Original file line number Diff line number Diff line change
Expand Up @@ -4393,7 +4393,7 @@ void MPanelReadPanelInfo(int flag)
MPanel.Beat = Panel->beat;
MPanel.UpdateFlag |= MP_UPDATE_METRONOME;
}
if (flag || MPanel.Keysig != Panel->keysig) {
if (flag || strcmp(MPanel.Keysig, Panel->keysig) != 0) {
strcpy(MPanel.Keysig, Panel->keysig);
MPanel.UpdateFlag |= MP_UPDATE_KEYSIG;
}
Expand Down
16 changes: 0 additions & 16 deletions timidity/flac_a.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,6 @@ static int flac_output_open(const char *fname, const char *comment)
#ifndef LEGACY_FLAC
FLAC__StreamEncoderInitStatus init_status;
#endif
FLAC__StreamMetadata_VorbisComment_Entry vendentry;
FLAC__StreamMetadata_VorbisComment_Entry commentry;

FLAC_ctx *ctx;

Expand Down Expand Up @@ -577,20 +575,6 @@ static int flac_output_open(const char *fname, const char *comment)
}
#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]) {
Expand Down
36 changes: 1 addition & 35 deletions timidity/vorbis_a.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ static int ogg_output_open(const char *fname, const char *comment)
#if !defined ( IA_W32GUI ) && !defined ( IA_W32G_SYN )
int bitrate;
#endif
int location_commented = 0;
int title_commented = 0;

#ifdef AU_VORBIS_DLL
Expand All @@ -261,8 +260,6 @@ static int ogg_output_open(const char *fname, const char *comment)

if(strcmp(fname, "-") == 0) {
fd = 1; /* data to stdout */
if(comment == NULL)
comment = "(stdout)";
} else {
/* Open the audio file */
#ifdef __W32__
Expand All @@ -277,8 +274,6 @@ static int ogg_output_open(const char *fname, const char *comment)
fname, strerror(errno));
return -1;
}
if(comment == NULL)
comment = fname;
}

has_loopinfo = 0;
Expand Down Expand Up @@ -313,8 +308,6 @@ static int ogg_output_open(const char *fname, const char *comment)
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;

Expand All @@ -323,36 +316,9 @@ static int ogg_output_open(const char *fname, const char *comment)
}
}

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 ) {
Expand Down

0 comments on commit 37f43a5

Please sign in to comment.