audio: two little fixes.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJdZmrEAAoJEEy22O7T6HE4hCIQAKT1DeSIHbfHnAM0oub9C6nn
 vYVx33IhTFBE6coumtm9g9zw3JAARhnKsPt8H1ikeMc5S9CtEWiMPHKIKXoMHvEF
 hIIlPoi5NZ1ie6TFC9WXRbVP/55SJ+fHzWR/T4WtvZ9h+0eQyVlJstBQe7R0DCTS
 ckyEU/SHtHfHjroc0pkUs/ojfY1KN/3vnU9wNC6uvM+2vImyUbPMq3eXiGEOgroV
 Bj6IZ7VFJU6i9YK6ureHzu+C9gcJ/81Op2NAhLgzSSpdODS6vxwpcOOW05hX30om
 aG8m3B9JJNaAdm7CvNnEmK3HXH5vrXsYzDZRHfaRzzejNNWRlQMLRM93fUwwI2fl
 MbTOkk7t4JoQSBiNxAKmQqK2Iallj+8PnM3/DALfvAgvQm4ofjpqMK9kH6s8Pfoe
 EWPEI7Fym1TYaqwllQqImHRqGPh3phIUKoXh1yFOWXcDkIyjgJjiFRDDUtcCzjil
 n6jE4GZrGHL6FOmMlx+YBozLV0pYoNybUVYtDPizzNf12Q941SKjJNDKFZmFEwW6
 ySzaHsQF/sUESHgtXkj2ntGyiHkZUtPcFlEDk0gx9STp/TTaoQlpbjVhiCVXoPS9
 lH3KjMUPM805zbyDqhfXgNzKBPyDKFG/4egfOj32wol5DfMtAzoHhYf1eCEeItQf
 KqDzyzBbNQZIMs58v6wn
 =UTyF
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190828-pull-request' into staging

audio: two little fixes.

# gpg: Signature made Wed 28 Aug 2019 12:51:32 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20190828-pull-request:
  audio: omitting audiodev= parameter is only deprecated
  audio: fix invalid malloc size in audio_create_pdos

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2019-09-03 14:03:15 +01:00
commit fec105c2ab
2 changed files with 12 additions and 5 deletions

View File

@ -1412,8 +1412,9 @@ static AudioState *audio_init(Audiodev *dev, const char *name)
drvname = AudiodevDriver_str(dev->driver);
} else if (!QTAILQ_EMPTY(&audio_states)) {
if (!legacy_config) {
dolog("You must specify an audiodev= for the device %s\n", name);
exit(1);
dolog("Device %s: audiodev default parameter is deprecated, please "
"specify audiodev=%s\n", name,
QTAILQ_FIRST(&audio_states)->dev->id);
}
return QTAILQ_FIRST(&audio_states);
} else {
@ -1548,8 +1549,7 @@ CaptureVoiceOut *AUD_add_capture(
if (!s) {
if (!legacy_config) {
dolog("You must specify audiodev when trying to capture\n");
return NULL;
dolog("Capturing without setting an audiodev is deprecated\n");
}
s = audio_init(NULL, NULL);
}
@ -1685,7 +1685,7 @@ void audio_create_pdos(Audiodev *dev)
} \
if (!dev->u.driver.has_out) { \
dev->u.driver.out = g_malloc0( \
sizeof(AudiodevAlsaPerDirectionOptions)); \
sizeof(Audiodev##pdo_name##PerDirectionOptions)); \
dev->u.driver.has_out = true; \
} \
break

View File

@ -72,6 +72,13 @@ backend settings instead of environment variables. To ease migration to
the new format, the ``-audiodev-help'' option can be used to convert
the current values of the environment variables to ``-audiodev'' options.
@subsection Creating sound card devices and vnc without audiodev= property (since 4.2)
When not using the deprecated legacy audio config, each sound card
should specify an @code{audiodev=} property. Additionally, when using
vnc, you should specify an @code{audiodev=} propery if you plan to
transmit audio through the VNC protocol.
@subsection -mon ...,control=readline,pretty=on|off (since 4.1)
The @code{pretty=on|off} switch has no effect for HMP monitors, but is