Commit b21c6cef authored by Segher Boessenkool's avatar Segher Boessenkool

Support utf8 in ogg123 and ogginfo.

svn path=/trunk/vorbis-tools/; revision=2944
parent d755b054
......@@ -12,7 +12,7 @@ INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@ @CURL_CFLAGS@ \
@PTHREAD_CFLAGS@ @SHARE_CFLAGS@
ogg123_LDADD = @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@ \
@SOCKET_LIBS@ @SHARE_LIBS@ @CURL_LIBS@ @PTHREAD_CFLAGS@ \
@SOCKET_LIBS@ @LIBICONV@ @SHARE_LIBS@ @CURL_LIBS@ @PTHREAD_CFLAGS@ \
@PTHREAD_LIBS@
ogg123_DEPENDENCIES = @SHARE_LIBS@
ogg123_SOURCES = audio.c buffer.c callbacks.c \
......
......@@ -14,7 +14,7 @@
* *
********************************************************************
last mod: $Id: ogg123.c,v 1.57 2002/01/01 15:43:29 volsung Exp $
last mod: $Id: ogg123.c,v 1.58 2002/01/03 10:40:40 segher Exp $
********************************************************************/
......@@ -28,6 +28,7 @@
#include <signal.h>
#include <unistd.h>
#include <sys/time.h>
#include <locale.h>
#include "audio.h"
#include "buffer.h"
......@@ -267,6 +268,8 @@ int main(int argc, char **argv)
{
int optind;
setlocale(LC_ALL, "");
ao_initialize();
stat_format = stat_format_create();
options_init(&options);
......
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: oggvorbis_format.c,v 1.3 2001/12/28 00:22:36 segher Exp $
last mod: $Id: oggvorbis_format.c,v 1.4 2002/01/03 10:40:40 segher Exp $
********************************************************************/
......@@ -22,6 +22,7 @@
#include <vorbis/vorbisfile.h>
#include "transport.h"
#include "format.h"
#include "utf8.h"
typedef struct ovf_private_t {
......@@ -339,10 +340,17 @@ void print_stream_comments (decoder_t *decoder)
return;
for (i = 0; i < priv->vc->comments; i++) {
char *decoded_value;
comment = priv->vc->user_comments[i];
comment_formatstr = lookup_comment_formatstr(comment, &offset);
cb->printf_metadata(decoder->callback_arg, 1,
if (utf8_decode(comment + offset, &decoded_value) >= 0) {
cb->printf_metadata(decoder->callback_arg, 1,
comment_formatstr, decoded_value);
free(decoded_value);
} else
cb->printf_metadata(decoder->callback_arg, 1,
comment_formatstr, comment + offset);
}
}
......
......@@ -14,6 +14,8 @@
#include <string.h>
#include <ogg/ogg.h>
#include <vorbis/codec.h>
#include <locale.h>
#include "utf8.h"
int dointegritycheck(char *filename);
......@@ -21,6 +23,8 @@ int main(int ac,char **av)
{
int i;
setlocale(LC_ALL, "");
if ( ac < 2 ) {
fprintf(stderr,"Usage: %s [filename1.ogg] ... [filenameN.ogg]\n",av[0]);
return(0);
......@@ -49,7 +53,12 @@ void print_header_info(vorbis_comment *vc, vorbis_info *vi)
int i;
for (i=0; i < vc->comments; i++) {
printf("%s\n",vc->user_comments[i]);
char *decoded_value;
if (utf8_decode(vc->user_comments[i], &decoded_value) >= 0)
printf("%s\n",decoded_value);
else
printf("%s\n",vc->user_comments[i]);
}
printf("vendor=%s\n", vc->vendor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment