Makes Workarounds command line configurable.

This commit is contained in:
Johns 2012-02-04 16:38:10 +01:00
parent 00cafd18ed
commit 8db8b68edd
3 changed files with 28 additions and 3 deletions

View File

@ -123,6 +123,8 @@ static const AudioModule NoopModule; ///< forward definition of noop module
// Variables // Variables
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
char AudioAlsaDriverBroken; ///< disable broken driver message
static const char *AudioModuleName; ///< which audio module to use static const char *AudioModuleName; ///< which audio module to use
/// Selected audio module. /// Selected audio module.
@ -334,7 +336,9 @@ static int AlsaPlayRingbuffer(void)
if (first) { if (first) {
// happens with broken alsa drivers // happens with broken alsa drivers
if (AudioThread) { if (AudioThread) {
if (!AudioAlsaDriverBroken) {
Error(_("audio/alsa: broken driver %d\n"), avail); Error(_("audio/alsa: broken driver %d\n"), avail);
}
usleep(5 * 1000); usleep(5 * 1000);
} }
} }

View File

@ -47,4 +47,10 @@ extern void AudioSetDeviceAC3(const char *); ///< set Passthrough device
extern void AudioInit(void); ///< setup audio module extern void AudioInit(void); ///< setup audio module
extern void AudioExit(void); ///< cleanup and exit audio module extern void AudioExit(void); ///< cleanup and exit audio module
//----------------------------------------------------------------------------
// Variables
//----------------------------------------------------------------------------
extern char AudioAlsaDriverBroken; ///< disable broken driver message
/// @} /// @}

View File

@ -1165,7 +1165,11 @@ const char *CommandLineHelp(void)
" -d display\tdisplay of x11 server (fe. :0.0)\n" " -d display\tdisplay of x11 server (fe. :0.0)\n"
" -f\t\tstart with fullscreen window (only with window manager)\n" " -f\t\tstart with fullscreen window (only with window manager)\n"
" -g geometry\tx11 window geometry wxh+x+y\n" " -g geometry\tx11 window geometry wxh+x+y\n"
" -x\t\tstart x11 server\n" " -s\t\tstart in suspended mode\n"; " -x\t\tstart x11 server\n" " -s\t\tstart in suspended mode\n"
" -w workaround\tenable/disable workarounds\n"
"\tno-hw-decoder\t\tdisable hw decoder, use software decoder only\n"
"\tno-mpeg-hw-decoder\tdisable hw decoder for mpeg only\n"
"\talsa-driver-broken\tdisable broken alsa driver message\n";
} }
/** /**
@ -1180,7 +1184,7 @@ int ProcessArgs(int argc, char *const argv[])
// Parse arguments. // Parse arguments.
// //
for (;;) { for (;;) {
switch (getopt(argc, argv, "-a:p:d:fg:xs")) { switch (getopt(argc, argv, "-a:d:fg:p:sw:x")) {
case 'a': // audio device case 'a': // audio device
AudioSetDevice(optarg); AudioSetDevice(optarg);
continue; continue;
@ -1207,6 +1211,17 @@ int ProcessArgs(int argc, char *const argv[])
case 's': // start in suspend mode case 's': // start in suspend mode
ConfigStartSuspended = 1; ConfigStartSuspended = 1;
continue; continue;
case 'w': // workarounds
if (!strcasecmp("no-hw-decoder", optarg)) {
} else if (!strcasecmp("no-mpeg-hw-decoder", optarg)) {
} else if (!strcasecmp("alsa-driver-broken", optarg)) {
AudioAlsaDriverBroken = 1;
} else {
fprintf(stderr, _("Workaround '%s' unsupported\n"),
optarg);
return 0;
}
continue;
case EOF: case EOF:
break; break;
case '-': case '-':