Date: Sun, 26 Dec 2004 20:55:40 +0900 (JST) From: Yamashiro Jun <yamajun@ofug.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/75511: Update port: new patch file for japanese/gqmpeg Message-ID: <20041226115540.5BB9E1570A4@ns.ofug.net> Resent-Message-ID: <200412261200.iBQC0ooB036295@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 75511 >Category: ports >Synopsis: Update port: new patch file for japanese/gqmpeg >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Dec 26 12:00:49 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Yamashiro, Jun >Release: FreeBSD 4.10-STABLE i386 >Organization: Okinawa FreeBSD Userg Group >Environment: System: FreeBSD ns.ofug.net 4.10-STABLE FreeBSD 4.10-STABLE #1042: Fri Nov 5 04:33:13 JST 2004 root@ns.ofug.net:/usr/obj/usr/src/sys/SABANI i386 >Description: Cannot compile japanese/gqmpeg with WITH_SJIS_TAG option. Cause of this problem is patch for old audio/gqmpeg. I wrote patch for new gqmpeg. >How-To-Repeat: # cd /usr/ports/japanese/gqmpeg # make WITH_SJIS_TAG=yes (snip) ===> Patching for ja-gqmpeg-0.20.0 ===> Applying extra patch /usr/ports/japanese/gqmpeg/files/extra-patch-src::japanese_tag.c ===> Applying extra patch /usr/ports/japanese/gqmpeg/files/extra-patch-src::japanese_tag.h ===> Applying extra patch /usr/ports/japanese/gqmpeg/files/extra-patch-src::mpg_tagutil.c 1 out of 2 hunks failed--saving rejects to ./src/mpg_tagutil.c.rej *** Error code 1 Stop in /usr/ports/japanese/gqmpeg. *** Error code 1 Stop in /usr/ports/japanese/gqmpeg. # >Fix: Change japanese/gqmpeg/files/extra-patch-src::mpg_tagutil.c to this patch. --- src/mpg_tagutil.c.orig Sun Aug 18 12:29:35 2002 +++ src/mpg_tagutil.c Sun Dec 26 01:58:21 2004 @@ -162,6 +162,12 @@ FILE *f; gchar buf[130]; gint i; +#ifdef ENABLE_JAPANESE_TAGS + gchar tmpbuf[31]; + gchar *ctp; + + tmpbuf[30] = '\0'; +#endif f = fopen(path,"r+"); if (!f) @@ -222,6 +228,86 @@ } strncpy(buf, "TAG", 3); +#ifdef ENABLE_JAPANESE_TAGS + if (title && *title) { + strncpy(tmpbuf, title, 30); + ctp = to_string_sjis_from_euc(tmpbuf); + if (ctp) { + strncpy(buf + 3, ctp, 30); + free(ctp); + } + else { + printf("fail to convert title tag encoding\n"); + fclose(f); + return FALSE; + } + } + if (artist && *artist) { + strncpy(tmpbuf, artist, 30); + ctp = to_string_sjis_from_euc(tmpbuf); + if (ctp) { + strncpy(buf + 33, ctp, 30); + free(ctp); + } + else { + printf("fail to convert artist tag encoding\n"); + fclose(f); + return FALSE; + } + } + if (album && *album) { + strncpy(tmpbuf, album, 30); + ctp = to_string_sjis_from_euc(tmpbuf); + if (ctp) { + strncpy(buf + 63, ctp, 30); + free(ctp); + } + else { + printf("fail to convert album tag encoding\n"); + fclose(f); + return FALSE; + } + } + if (year) strncpy(buf + 93, year, 4); + if (comment && track == 0 && strlen(ctp) > 28) + { + /* comment is longer than 28 and no track number, + * write a v1.0 tag to enable larger comments + */ + strncpy(tmpbuf, comment, 30); + ctp = to_string_sjis_from_euc(tmpbuf); + if (ctp) + { + strncpy(buf + 97, ctp, 30); + free(ctp); + } + else + { + printf("fail to convert comment tag encoding\n"); + fclose(f); + return FALSE; + } + + } + else + { + buf[126] = track; + + strncpy(tmpbuf, comment, 30); + ctp = to_string_sjis_from_euc(tmpbuf); + if (ctp) + { + strncpy(buf + 97, ctp, 28); + free(ctp); + } + else + { + printf("fail to convert comment tag encoding\n"); + fclose(f); + return FALSE; + } + } +#else if (title) strncpy(buf + 3, title, 30); if (artist) strncpy(buf + 33, artist, 30); if (album) strncpy(buf + 63, album, 30); @@ -239,6 +325,7 @@ if (comment) strncpy(buf + 97, comment, 28); buf[126] = track; } +#endif buf[127] = genre; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041226115540.5BB9E1570A4>