12
12
********************************************************************
14
last mod: $Id: callbacks.c,v 1.3 2001/12/26 14:22:26 segher Exp $
14
last mod: $Id: callbacks.c,v 1.9 2003/09/05 19:25:30 volsung Exp $
16
16
********************************************************************/
41
42
audio_device_t *current;
42
43
ao_sample_format format;
44
/* We DO NOT want to get cancelled part way through this and have our
45
audio devices in an unknown state */
46
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
49
45
close_audio_devices (reopen_arg->devices);
51
47
/* Record audio device settings and open the devices */
67
63
current->device = ao_open_file(current->driver_id, current->filename,
68
0, &format, current->options);
64
1 /*overwrite*/, &format,
70
67
/* Report errors */
71
68
if (current->device == NULL) {
74
status_error("Error: Device not available.\n");
71
status_error(_("Error: Device not available.\n"));
77
status_error("Error: %s requires an output filename to be specified with -f.\n", info->short_name);
74
status_error(_("Error: %s requires an output filename to be specified with -f.\n"), info->short_name);
79
76
case AO_EBADOPTION:
80
status_error("Error: Unsupported option value to %s device.\n",
77
status_error(_("Error: Unsupported option value to %s device.\n"),
83
80
case AO_EOPENDEVICE:
84
status_error("Error: Cannot open device %s.\n",
81
status_error(_("Error: Cannot open device %s.\n"),
88
status_error("Error: Device %s failure.\n", info->short_name);
85
status_error(_("Error: Device %s failure.\n"), info->short_name);
91
status_error("Error: An output file cannot be given for %s device.\n", info->short_name);
88
status_error(_("Error: An output file cannot be given for %s device.\n"), info->short_name);
94
status_error("Error: Cannot open file %s for writing.\n",
91
status_error(_("Error: Cannot open file %s for writing.\n"),
95
92
current->filename);
97
94
case AO_EFILEEXISTS:
98
status_error("Error: File %s already exists.\n", current->filename);
95
status_error(_("Error: File %s already exists.\n"), current->filename);
101
status_error("Error: This error should never happen. Panic!\n");
98
status_error(_("Error: This error should never happen (%d). Panic!\n"), errno);
123
118
audio_reopen_arg_t *arg;
125
120
if ( (arg = malloc(sizeof(audio_reopen_arg_t))) == NULL ) {
126
status_error("Error: Out of memory in new_audio_reopen_arg().\n");
121
status_error(_("Error: Out of memory in new_audio_reopen_arg().\n"));
130
125
if ( (arg->format = malloc(sizeof(audio_format_t))) == NULL ) {
131
status_error("Error: Out of memory in new_audio_reopen_arg().\n");
126
status_error(_("Error: Out of memory in new_audio_reopen_arg().\n"));
171
167
print_statistics_arg_t *arg;
173
169
if ( (arg = malloc(sizeof(print_statistics_arg_t))) == NULL ) {
174
status_error("Error: Out of memory in new_print_statistics_arg().\n");
170
status_error(_("Error: Out of memory in new_print_statistics_arg().\n"));
230
226
status_message_arg_t *arg;
232
228
if ( (arg = malloc(sizeof(status_message_arg_t))) == NULL ) {
233
status_error("Error: Out of memory in new_status_message_arg().\n");
229
status_error(_("Error: Out of memory in new_status_message_arg().\n"));
276
272
straight from the vsnprintf() man page. We do this here because
277
273
we might need to reinit ap several times. */
278
274
if ((sm_arg->message = malloc (size)) == NULL) {
279
status_error("Error: Out of memory in decoder_buffered_metadata_callback().\n");
275
status_error(_("Error: Out of memory in decoder_buffered_metadata_callback().\n"));
295
291
else /* glibc 2.0 */
296
292
size *= 2; /* twice the old size */
297
293
if ((sm_arg->message = realloc (sm_arg->message, size)) == NULL) {
298
status_error("Error: Out of memory in decoder_buffered_metadata_callback().\n");
294
status_error(_("Error: Out of memory in decoder_buffered_metadata_callback().\n"));
332
328
straight from the vsnprintf() man page. We do this here because
333
329
we might need to reinit ap several times. */
334
330
if ((sm_arg->message = malloc (size)) == NULL) {
335
status_error("Error: Out of memory in decoder_buffered_metadata_callback().\n");
331
status_error(_("Error: Out of memory in decoder_buffered_metadata_callback().\n"));
351
347
else /* glibc 2.0 */
352
348
size *= 2; /* twice the old size */
353
349
if ((sm_arg->message = realloc (sm_arg->message, size)) == NULL) {
354
status_error("Error: Out of memory in decoder_buffered_metadata_callback().\n");
350
status_error(_("Error: Out of memory in decoder_buffered_metadata_callback().\n"));
355
sm_arg->verbosity = verbosity;
359
356
buffer_append_action_at_end(buf, &status_message_action, sm_arg);