Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
Lutro
Commits
75c2b205
Unverified
Commit
75c2b205
authored
Mar 28, 2021
by
RobLoach
Committed by
GitHub
Mar 28, 2021
Browse files
Merge pull request #183 from piepacker/jake/printf_cleanup
Cleanup fprintf(stderr) usage, remove a lot of spurious fflush calls
parents
6aa05e05
fe14821e
Changes
2
Hide whitespace changes
Inline
Side-by-side
audio.c
View file @
75c2b205
...
...
@@ -253,7 +253,6 @@ void lutro_audio_deinit()
if
(
counted
)
{
fprintf
(
stderr
,
"Found %d leaked audio source references. Was lua_close() called first?
\n
"
,
counted
);
fflush
(
stderr
);
//assert(false);
return
;
}
...
...
@@ -497,7 +496,6 @@ int source_seek(lua_State *L)
// TODO: it'd be nice to log with the full lua FILE(LINE): context that's normally prefixed by lua_error,
// in a manner that allows us to log it without stopping the system. --jstine
fprintf
(
stderr
,
"WAV decoder seek failed: %s
\n
"
,
strerror
(
errno
));
fflush
(
stdout
);
}
self
->
sndpos
=
decWav_sampleTell
(
self
->
wavData
);
}
...
...
@@ -519,7 +517,6 @@ int source_seek(lua_State *L)
{
// the underlying media source will fixup the seek position...
fprintf
(
stderr
,
"warning: seek asked for sample pos %jd, got pos %jd
\n
"
,
npSamples
,
self
->
sndpos
);
fflush
(
stderr
);
}
return
0
;
}
...
...
@@ -556,7 +553,6 @@ int source_gc(lua_State *L)
if
(
leaks
)
{
fprintf
(
stderr
,
"source_gc: playing audio references were nullified.
\n
"
);
fflush
(
stderr
);
//assert(false);
}
...
...
decoder.c
View file @
75c2b205
...
...
@@ -4,7 +4,6 @@
#include <errno.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include "decoder.h"
#include "audio.h"
...
...
@@ -37,7 +36,7 @@ bool decOgg_init(dec_OggData *data, const char *filename)
data
->
info
=
NULL
;
if
(
ov_fopen
(
filename
,
&
data
->
vf
)
<
0
)
{
printf
(
"Failed to open vorbis file: %s"
,
filename
);
f
printf
(
stderr
,
"Failed to open vorbis file: %s
\n
"
,
filename
);
return
false
;
}
...
...
@@ -47,7 +46,7 @@ bool decOgg_init(dec_OggData *data, const char *filename)
data
->
info
=
(
vorbis_info
*
)
ov_info
(
&
data
->
vf
,
0
);
if
(
!
data
->
info
)
{
printf
(
"couldn't get info for file"
);
f
printf
(
stderr
,
"couldn't get info for file
\n
"
);
return
false
;
}
...
...
@@ -56,13 +55,13 @@ bool decOgg_init(dec_OggData *data, const char *filename)
if
(
data
->
info
->
channels
!=
1
&&
data
->
info
->
channels
!=
2
)
{
printf
(
"unsupported number of channels
\n
"
);
f
printf
(
stderr
,
"unsupported number of channels
\n
"
);
return
false
;
}
if
(
data
->
info
->
rate
!=
44100
)
{
printf
(
"unsupported sample rate
\n
"
);
f
printf
(
stderr
,
"unsupported sample rate
\n
"
);
return
false
;
}
...
...
@@ -114,7 +113,7 @@ bool decOgg_decode(dec_OggData *data, presaturate_buffer_desc *buffer, float vol
if
(
ret
<
0
)
{
printf
(
"Vorbis decoding failed with: %jd
\n
"
,
ret
);
f
printf
(
stderr
,
"Vorbis decoding failed with: %jd
\n
"
,
ret
);
return
true
;
}
...
...
@@ -211,14 +210,12 @@ bool decWav_init(dec_WavData *data, const char *filename)
return
0
;
fprintf
(
stderr
,
"Failed to open wavfile '%s': %s
\n
"
,
filename
,
strerror
(
err
));
fflush
(
stderr
);
return
0
;
}
if
(
fread
(
&
data
->
head
,
WAV_HEADER_SIZE
,
1
,
fp
)
==
0
)
{
fprintf
(
stderr
,
"%s is not a valid wav file or is truncated.
\n
"
,
filename
);
fflush
(
stderr
);
fclose
(
fp
);
return
0
;
}
...
...
@@ -252,7 +249,6 @@ bool decWav_seek(dec_WavData *data, intmax_t samplepos)
// logging here could be unnecessarily spammy. If we add a log it should be gated by
// some audio diagnostic output switch/mode.
//fprintf(stderr, "WAV decoder seek failed: %s\n", strerror(errno));
//fflush(stdout);
return
0
;
}
data
->
pos
=
samplepos
*
bps
;
...
...
@@ -276,7 +272,6 @@ intmax_t decWav_sampleTell(dec_WavData *data)
data
->
head
.
NumChannels
,
ret
);
fflush
(
stderr
);
}
}
return
ret
/
bps
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment