Commit f6f54277 authored by ivo's avatar ivo

Gettexted a few more strings. Cleaned up useless white space. Made error and...

Gettexted a few more strings.  Cleaned up useless white space.  Made error and warning messages consistant (no combination of upper and lower case).  Some polishing.

svn path=/trunk/vorbis-tools/; revision=15343
parent 17b124a7
......@@ -4,7 +4,7 @@ vorbis-tools 1.3.0 -- Unreleased
* Corrected problems in the Visual Studio project files
* Updated po files from the Translation Project
* Added new en_GB.po, eo.po, pl.po, sk.po and vi.po translation files
* Added AC_USE_SYSTEM_EXTENSIONS to configure.ac; no more autogen.sh warnings
* Added AC_USE_SYSTEM_EXTENSIONS to configure.ac; no more configure warnings
* Corrected SUBLANG values in intl/localename.c (#1415)
* Modify -v to -V on oggenc and oggdec for consistency (#1112)
* Fix for utf8_decode in Windows; improves behavior in vorbiscomment (#268)
......
......@@ -42,7 +42,7 @@ audio_device_t *append_audio_device(audio_device_t *devices_list,
ao_option *options, char *filename)
{
audio_device_t *head = devices_list;
if (devices_list != NULL) {
while (devices_list->next_device != NULL)
devices_list = devices_list->next_device;
......@@ -56,7 +56,7 @@ audio_device_t *append_audio_device(audio_device_t *devices_list,
devices_list->filename = filename;
devices_list->device = NULL;
devices_list->next_device = NULL;
return devices_list;
}
......@@ -77,23 +77,23 @@ int add_ao_option(ao_option **op_h, const char *optstring)
{
char *key, *value;
int result;
key = strdup(optstring);
if (key == NULL)
return 0;
value = strchr(key, ':');
if (value == NULL) {
free(key);
return 0;
}
/* split by replacing the separator with a null */
*value++ = '\0';
result = ao_append_option(op_h, key, value);
free(key);
return (result);
}
......
......@@ -114,7 +114,7 @@ action_t *malloc_action (action_func_t action_func, void *action_arg)
action = malloc(sizeof(action_t));
if (action == NULL) {
fprintf(stderr, _("Error: Out of memory in malloc_action().\n"));
fprintf(stderr, _("ERROR: Out of memory in malloc_action().\n"));
exit(1);
}
......@@ -336,7 +336,7 @@ int submit_data_chunk (buf_t *buf, char *data, size_t size)
if (!buf->prebuffering && !buf->paused) {
DEBUG("Signalling playback thread that more data is available.");
COND_SIGNAL(buf->playback_cond);
COND_SIGNAL(buf->playback_cond);
} else
DEBUG("Not signalling playback thread since prebuffering or paused.");
......@@ -357,7 +357,7 @@ buffer_stats_t *malloc_buffer_stats ()
new_stats = malloc(sizeof(buffer_stats_t));
if (new_stats == NULL) {
fprintf(stderr, _("Error: Could not allocate memory in malloc_buffer_stats()\n"));
fprintf(stderr, _("ERROR: Could not allocate memory in malloc_buffer_stats()\n"));
exit(1);
}
......@@ -636,7 +636,7 @@ void buffer_action_now (buf_t *buf, action_func_t action_func,
void *action_arg)
{
action_t *action;
action = malloc_action(action_func, action_arg);
pthread_cleanup_push(buffer_mutex_unlock, buf);
......
......@@ -47,7 +47,7 @@ void audio_reopen_action (buf_t *buf, void *arg)
ao_sample_format format;
close_audio_devices (reopen_arg->devices);
/* Record audio device settings and open the devices */
format.rate = reopen_arg->format->rate;
format.channels = reopen_arg->format->channels;
......@@ -59,7 +59,7 @@ void audio_reopen_action (buf_t *buf, void *arg)
while (current != NULL) {
ao_info *info = ao_driver_info(current->driver_id);
if (current->filename == NULL)
current->device = ao_open_live(current->driver_id, &format,
current->options);
......@@ -67,46 +67,46 @@ void audio_reopen_action (buf_t *buf, void *arg)
current->device = ao_open_file(current->driver_id, current->filename,
1 /*overwrite*/, &format,
current->options);
/* Report errors */
if (current->device == NULL) {
switch (errno) {
case AO_ENODRIVER:
status_error(_("Error: Device not available.\n"));
status_error(_("ERROR: Device not available.\n"));
break;
case AO_ENOTLIVE:
status_error(_("Error: %s requires an output filename to be specified with -f.\n"), info->short_name);
status_error(_("ERROR: %s requires an output filename to be specified with -f.\n"), info->short_name);
break;
case AO_EBADOPTION:
status_error(_("Error: Unsupported option value to %s device.\n"),
status_error(_("ERROR: Unsupported option value to %s device.\n"),
info->short_name);
break;
case AO_EOPENDEVICE:
status_error(_("Error: Cannot open device %s.\n"),
status_error(_("ERROR: Cannot open device %s.\n"),
info->short_name);
break;
case AO_EFAIL:
status_error(_("Error: Device %s failure.\n"), info->short_name);
status_error(_("ERROR: Device %s failure.\n"), info->short_name);
break;
case AO_ENOTFILE:
status_error(_("Error: An output file cannot be given for %s device.\n"), info->short_name);
status_error(_("ERROR: An output file cannot be given for %s device.\n"), info->short_name);
break;
case AO_EOPENFILE:
status_error(_("Error: Cannot open file %s for writing.\n"),
status_error(_("ERROR: Cannot open file %s for writing.\n"),
current->filename);
break;
case AO_EFILEEXISTS:
status_error(_("Error: File %s already exists.\n"), current->filename);
status_error(_("ERROR: File %s already exists.\n"), current->filename);
break;
default:
status_error(_("Error: This error should never happen (%d). Panic!\n"), errno);
status_error(_("ERROR: This error should never happen (%d). Panic!\n"), errno);
break;
}
/* We cannot recover from any of these errors */
exit(1);
exit(1);
}
current = current->next_device;
}
......@@ -122,15 +122,15 @@ audio_reopen_arg_t *new_audio_reopen_arg (audio_device_t *devices,
audio_reopen_arg_t *arg;
if ( (arg = malloc(sizeof(audio_reopen_arg_t))) == NULL ) {
status_error(_("Error: Out of memory in new_audio_reopen_arg().\n"));
status_error(_("ERROR: Out of memory in new_audio_reopen_arg().\n"));
exit(1);
}
}
if ( (arg->format = malloc(sizeof(audio_format_t))) == NULL ) {
status_error(_("Error: Out of memory in new_audio_reopen_arg().\n"));
status_error(_("ERROR: Out of memory in new_audio_reopen_arg().\n"));
exit(1);
}
}
arg->devices = devices;
/* Copy format in case fmt is recycled later */
*arg->format = *fmt;
......@@ -173,8 +173,8 @@ print_statistics_arg_t *new_print_statistics_arg (
if ( (arg = malloc(sizeof(print_statistics_arg_t))) == NULL ) {
status_error(_("Error: Out of memory in new_print_statistics_arg().\n"));
exit(1);
}
}
arg->stat_format = stat_format;
arg->data_source_statistics = data_source_statistics;
arg->decoder_statistics = decoder_statistics;
......@@ -230,15 +230,15 @@ status_message_arg_t *new_status_message_arg (int verbosity)
status_message_arg_t *arg;
if ( (arg = malloc(sizeof(status_message_arg_t))) == NULL ) {
status_error(_("Error: Out of memory in new_status_message_arg().\n"));
status_error(_("ERROR: Out of memory in new_status_message_arg().\n"));
exit(1);
}
}
arg->verbosity = verbosity;
return arg;
}
void status_error_action (buf_t *buf, void *arg)
{
......@@ -279,13 +279,13 @@ void decoder_buffered_error_callback (void *arg, int severity,
status_error(_("Error: Out of memory in decoder_buffered_metadata_callback().\n"));
exit(1);
}
while (1) {
/* Try to print in the allocated space. */
va_start(ap, message);
n = vsnprintf (sm_arg->message, size, message, ap);
va_end(ap);
/* If that worked, return the string. */
if (n > -1 && n < size)
break;
......@@ -300,10 +300,10 @@ void decoder_buffered_error_callback (void *arg, int severity,
}
}
switch (severity) {
case ERROR:
buffer_append_action_at_end(buf, &status_error_action, sm_arg);
buffer_append_action_at_end(buf, &status_error_action, sm_arg);
break;
case WARNING:
sm_arg->verbosity = WARNING_VERBOSITY;
......@@ -332,16 +332,16 @@ void decoder_buffered_metadata_callback (void *arg, int verbosity,
straight from the vsnprintf() man page. We do this here because
we might need to reinit ap several times. */
if ((sm_arg->message = malloc (size)) == NULL) {
status_error(_("Error: Out of memory in decoder_buffered_metadata_callback().\n"));
status_error(_("ERROR: Out of memory in decoder_buffered_metadata_callback().\n"));
exit(1);
}
while (1) {
/* Try to print in the allocated space. */
va_start(ap, message);
n = vsnprintf (sm_arg->message, size, message, ap);
va_end(ap);
/* If that worked, return the string. */
if (n > -1 && n < size)
break;
......@@ -351,7 +351,7 @@ void decoder_buffered_metadata_callback (void *arg, int verbosity,
else /* glibc 2.0 */
size *= 2; /* twice the old size */
if ((sm_arg->message = realloc (sm_arg->message, size)) == NULL) {
status_error(_("Error: Out of memory in decoder_buffered_metadata_callback().\n"));
status_error(_("ERROR: Out of memory in decoder_buffered_metadata_callback().\n"));
exit(1);
}
}
......
......@@ -132,18 +132,18 @@ void file_options_describe (file_option_t opts[], FILE *f)
/* Column headers */
/* Name */
totalWidth += fprintf (f, "%-*s", colWidths[0], _("Name"));
/* Description */
totalWidth += fprintf (f, "%-*s", colWidths[1], _("Description"));
/* Type */
totalWidth += fprintf (f, "%-*s", colWidths[2], _("Type"));
/* Default */
totalWidth += fprintf (f, "%-*s", colWidths[3], _("Default"));
fputc ('\n', f);
/* Divider */
print_space (f, totalWidth, '-');
......@@ -256,12 +256,12 @@ parse_code_t parse_line (file_option_t opts[], char *line)
/* remove this if you want a zero-length key */
if (strlen(line) == 0)
return parse_nokey;
if (value) {
/* cut leading whitespace from value */
while (*value == ' ')
value++;
/* cut trailing whitespace from value */
len = strlen (value);
while (len > 0 && value[len-1] == ' ') {
......
......@@ -168,7 +168,7 @@ int parse_cmdline_options (int argc, char **argv,
cmdline_usage();
exit(0);
break;
case 'p':
ogg123_opts->input_prebuffer = atof (optarg);
if (ogg123_opts->input_prebuffer < 0.0f ||
......@@ -261,7 +261,7 @@ int parse_cmdline_options (int argc, char **argv,
status_error(_("--- Driver %s specified in configuration file invalid.\n"),
ogg123_opts->default_device);
}
/* Then try libao autodetect */
if (temp_driver_id < 0)
temp_driver_id = ao_default_driver_id();
......@@ -311,7 +311,7 @@ void cmdline_usage (void)
printf (_(" -d dev, --device dev Use output device \"dev\". Available devices:\n"));
printf (" ");
printf (_("Live:"));
for(i = 0, j = 0; i < driver_count; i++) {
if (devices[i]->type == AO_TYPE_LIVE) {
printf ("%c %s", LIST_SEP(j), devices[i]->short_name);
......@@ -337,7 +337,7 @@ void cmdline_usage (void)
" device previously specified with --device. See\n"
" the ogg123 man page for available device options.\n"));
printf ("\n");
printf (_("Playlist options\n"));
printf (_(" -@ file, --list file Read playlist of files and URLs from \"file\"\n"));
printf (_(" -r, --repeat Repeat playlist indefinitely\n"));
......
......@@ -55,13 +55,13 @@ data_source_t* file_open (char *source_string, ogg123_options_t *ogg123_opts)
source->source_string = strdup(source_string);
source->transport = &file_transport;
source->private = private;
private->seekable = 1;
private->stats.transfer_rate = 0;
private->stats.bytes_read = 0;
private->stats.input_buffer_used = 0;
} else {
fprintf(stderr, _("Error: Out of memory.\n"));
fprintf(stderr, _("ERROR: Out of memory.\n"));
exit(1);
}
......@@ -76,7 +76,7 @@ data_source_t* file_open (char *source_string, ogg123_options_t *ogg123_opts)
free(source->source_string);
free(private);
free(source);
return NULL;
}
......@@ -97,7 +97,7 @@ int file_peek (data_source_t *source, void *ptr, size_t size, size_t nmemb)
start = ftell(fp);
items = fread(ptr, size, nmemb, fp);
/* Now go back so we maintain the peek() semantics */
if (fseek(fp, start, SEEK_SET) != 0)
items = 0; /* Flag error condition since we couldn't seek back to
......
......@@ -58,11 +58,11 @@ typedef struct {
long bytes_read_previous;
FLAC__StreamMetadata *comments;
int bos; /* At beginning of stream */
int eos; /* End of stream read */
/* Buffer for decoded audio */
FLAC__int32 **buf; /* channels by buf_len array */
int buf_len;
......@@ -70,7 +70,7 @@ typedef struct {
int buf_fill; /* Number of bytes of audio data in buffer */
decoder_stats_t stats;
} flac_private_t;
/* Forward declarations */
......@@ -106,7 +106,7 @@ int flac_can_decode (data_source_t *source)
int len;
len = source->transport->peek(source, buf, sizeof(char), 4);
if (len >= 4 && memcmp(buf, "fLaC", 4) == 0)
return 1; /* Naked FLAC */
else
......@@ -120,7 +120,7 @@ int oggflac_can_decode (data_source_t *source)
int len;
len = source->transport->peek(source, buf, sizeof(char), 36);
if (len >= 36 && memcmp(buf, "OggS", 4) == 0
&& memcmp(buf+28, "fLaC", 4) == 0) {
/* old Ogg FLAC , pre flac 1.1.1 */
......@@ -184,7 +184,7 @@ decoder_t* flac_init (data_source_t *source, ogg123_options_t *ogg123_opts,
private->buf_len = 0;
private->buf_fill = 0;
private->buf_start = 0;
/* Setup FLAC decoder */
#if NEED_EASYFLAC
if (oggflac_can_decode(source)) {
......@@ -223,7 +223,7 @@ decoder_t* flac_init (data_source_t *source, ogg123_options_t *ogg123_opts,
else
FLAC__stream_decoder_init_stream(private->decoder, read_callback, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, eof_callback, write_callback, metadata_callback, error_callback, decoder);
#endif
/* Callback will set the total samples and sample rate */
#if NEED_EASYFLAC
EasyFLAC__process_until_end_of_metadata(private->decoder);
......@@ -257,7 +257,7 @@ int flac_read (decoder_t *decoder, void *ptr, int nbytes, int *eos,
long samples, realsamples = 0;
FLAC__bool ret;
int i,j;
/* Read comments and audio info at the start of a logical bitstream */
if (priv->bos) {
decoder->actual_fmt.rate = priv->rate;
......@@ -378,10 +378,10 @@ void flac_cleanup (decoder_t *decoder)
{
flac_private_t *priv = decoder->private;
int i;
for (i = 0; i < priv->channels; i++)
free(priv->buf[i]);
free(priv->buf);
#if NEED_EASYFLAC
EasyFLAC__finish(priv->decoder);
......@@ -435,7 +435,7 @@ FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder,
*bytes = read;
priv->bytes_read += read;
/* Immediately return if errors occured */
if(read == 0)
return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
......@@ -457,19 +457,19 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder
int channels = frame->header.channels;
int bits_per_sample = priv->bits_per_sample = frame->header.bits_per_sample;
int i, j;
resize_buffer(priv, channels, samples);
for (i = 0; i < channels; i++)
for (j = 0; j < samples; j++)
priv->buf[i][j] = buffer[i][j];
priv->buf_start = 0;
priv->buf_fill = samples;
priv->samples_decoded += samples;
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
......@@ -488,7 +488,7 @@ void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMet
priv->totalsamples = metadata->data.stream_info.total_samples;
priv->rate = metadata->data.stream_info.sample_rate;
break;
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
priv->comments = FLAC__metadata_object_clone(metadata);
break;
......@@ -522,27 +522,27 @@ FLAC__bool eof_callback(const FLAC__StreamDecoder *decoder, void *client_data)
void resize_buffer(flac_private_t *flac, int newchannels, int newsamples)
{
int i;
if (newchannels == flac->channels && newsamples == flac->buf_len) {
flac->buf_start = 0;
flac->buf_fill = 0;
return;
}
/* Not the most efficient approach, but it is easy to follow */
if(newchannels != flac->channels) {
/* Deallocate all of the sample vectors */
for (i = 0; i < flac->channels; i++)
free(flac->buf[i]);
flac->buf = realloc(flac->buf, sizeof(FLAC__int32*) * newchannels);
flac->channels = newchannels;
}
for (i = 0; i < newchannels; i++)
flac->buf[i] = malloc(sizeof(FLAC__int32) * newsamples);
flac->buf_len = newsamples;
flac->buf_start = 0;
flac->buf_fill = 0;
......@@ -557,9 +557,9 @@ void print_flac_stream_info (decoder_t *decoder)
if (cb == NULL || cb->printf_metadata == NULL)
return;
#if NEED_EASYFLAC
if (EasyFLAC__is_oggflac(priv->decoder))
#else
......@@ -584,22 +584,21 @@ void print_flac_comments (FLAC__StreamMetadata_VorbisComment *f_comments,
int i;
char *temp = NULL;
int temp_len = 0;
for (i = 0; i < f_comments->num_comments; i++) {
/* Gotta null terminate these things */
if (temp_len < f_comments->comments[i].length + 1) {
temp_len = f_comments->comments[i].length + 1;
temp = realloc(temp, sizeof(char) * temp_len);
}
strncpy(temp, f_comments->comments[i].entry,
f_comments->comments[i].length);
temp[f_comments->comments[i].length] = '\0';
print_vorbis_comment(temp, cb, callback_arg);
}
free(temp);
}
......@@ -79,7 +79,7 @@ decoder_stats_t *malloc_decoder_stats (decoder_stats_t *to_copy)
new_stats = malloc(sizeof(decoder_stats_t));
if (new_stats == NULL) {
fprintf(stderr, _("Error: Could not allocate memory in malloc_decoder_stats()\n"));
fprintf(stderr, _("ERROR: Could not allocate memory in malloc_decoder_stats()\n"));
exit(1);
}
......
......@@ -142,7 +142,7 @@ void *curl_thread_func (void *arg)
sigaddset (&set, SIGTSTP);
sigaddset (&set, SIGCONT);
if (pthread_sigmask (SIG_BLOCK, &set, NULL) != 0)
status_error(_("Error: Could not set signal mask."));
status_error(_("ERROR: Could not set signal mask."));
ret = curl_easy_perform((CURL *) myarg->curl_handle);
......@@ -199,7 +199,7 @@ data_source_t* http_open (char *source_string, ogg123_options_t *ogg123_opts)
buffer in pull mode. */
0 /* Irrelevant */);
if (private->buf == NULL) {
status_error(_("Error: Unable to create input buffer.\n"));
status_error(_("ERROR: Unable to create input buffer.\n"));
exit(1);
}
......@@ -212,7 +212,7 @@ data_source_t* http_open (char *source_string, ogg123_options_t *ogg123_opts)
private->cancel_flag = 0;
} else {
fprintf(stderr, _("Error: Out of memory.\n"));
fprintf(stderr, _("ERROR: Out of memory.\n"));
exit(1);
}
......
......@@ -186,7 +186,7 @@ void set_seek_opt(ogg123_options_t *ogg123_opts, char *buf) {
/* skip spaces */
while (*b && (*b == ' ')) b++;
if (*b == '-') {
/* relative seek back */
ogg123_opts->seekoff = -1 * strtotime(b+1);
......@@ -374,7 +374,7 @@ void print_audio_devices_info(audio_device_t *d)
while (d != NULL) {
info = ao_driver_info(d->driver_id);
status_message(2, _("\nAudio Device: %s"), info->name);
status_message(3, _("Author: %s"), info->author);
status_message(3, _("Comments: %s"), info->comment);
......@@ -421,7 +421,7 @@ int main(int argc, char **argv)
if (S_ISDIR(stat_buf.st_mode)) {
if (playlist_append_directory(options.playlist, argv[i]) == 0)
fprintf(stderr,
_("Warning: Could not read directory %s.\n"), argv[i]);
_("WARNING: Could not read directory %s.\n"), argv[i]);
} else {
playlist_append_file(options.playlist, argv[i]);
}
......@@ -615,7 +615,7 @@ void play (char *source_string)
while (!eof && !sig_request.exit) {
/* Loop through data within a logical bitstream */
eos = 0;
eos = 0;
while (!eos && !sig_request.exit) {
/* Check signals */
......@@ -659,7 +659,7 @@ void play (char *source_string)
eof = eos = 1;
break;
} else if (ret < 0) {
status_error(_("Error: Decoding failure.\n"));
status_error(_("ERROR: Decoding failure.\n"));
break;
}
......@@ -674,7 +674,7 @@ void play (char *source_string)
reopen_arg = new_audio_reopen_arg(options.devices, &new_audio_fmt);
if (audio_buffer)
if (audio_buffer)
buffer_insert_action_at_end(audio_buffer, &audio_reopen_action,
reopen_arg);
else
......@@ -702,7 +702,7 @@ void play (char *source_string)
if (nthc-- == 0) {
if (audio_buffer) {
if (!buffer_submit_data(audio_buffer, convbuffer, ret)) {
status_error(_("Error: buffer write failed.\n"));
status_error(_("ERROR: buffer write failed.\n"));
eof = eos = 1;
break;
}
......
......@@ -92,18 +92,18 @@ decoder_t* ovf_init (data_source_t *source, ogg123_options_t *ogg123_opts,
private->stats.instant_bitrate = 0;
private->stats.avg_bitrate = 0;
} else {
fprintf(stderr, _("Error: Out of memory.\n"));
fprintf(stderr, _("ERROR: Out of memory.\n"));
exit(1);
}
/* Initialize vorbisfile decoder */
ret = ov_open_callbacks (decoder, &private->vf, NULL, 0,
vorbisfile_callbacks);
if (ret < 0) {
free(private);
/* free(source); nope. caller frees. */
/* free(source); nope. caller frees. */
return NULL;
}
......@@ -128,7 +128,7 @@ int ovf_read (decoder_t *decoder, void *ptr, int nbytes, int *eos,
decoder->actual_fmt.rate = priv->vi->rate;
decoder->actual_fmt.channels = priv->vi->channels;
print_vorbis_stream_info(decoder);
print_vorbis_comments(priv->vc, cb, decoder->callback_arg);
priv->bos = 0;
......@@ -151,22 +151,22 @@ int ovf_read (decoder_t *decoder, void *ptr, int nbytes, int *eos,
break;
} else if (ret == OV_HOLE) {
if (cb->printf_error != NULL)
cb->printf_error(decoder->callback_arg, INFO,
_("--- Hole in the stream; probably harmless\n"));
} else if (ret < 0) {
if (cb->printf_error != NULL)
cb->printf_error(decoder->callback_arg, ERROR,
_("=== Vorbis library reported a stream error.\n"));
/* EOF */
*eos = 1;
break;
} else {
bytes_read += ret;
ptr = (void *)((unsigned char *)ptr + ret);
nbytes -= ret;
......@@ -181,7 +181,7 @@ int ovf_read (decoder_t *decoder, void *ptr, int nbytes, int *eos,
}
}
return bytes_read;
}
......@@ -305,7 +305,7 @@ void print_vorbis_stream_info (decoder_t *decoder)
if (cb == NULL || cb->printf_metadata == NULL)
return;