virDomainAudioIOCommon: Change type of format to virDomainAudioFormat

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-27 17:04:32 +02:00 committed by Ján Tomko
parent bb94b3d28d
commit c9876ccf56
2 changed files with 9 additions and 6 deletions

View File

@ -13120,11 +13120,14 @@ virDomainAudioCommonParse(virDomainAudioIOCommon *def,
return -1;
}
if (format &&
(def->format = virDomainAudioFormatTypeFromString(format)) <= 0) {
virReportError(VIR_ERR_XML_ERROR,
_("cannot parse 'format' value '%s'"), format);
return -1;
if (format) {
int value;
if ((value = virDomainAudioFormatTypeFromString(format)) <= 0) {
virReportError(VIR_ERR_XML_ERROR,
_("cannot parse 'format' value '%s'"), format);
return -1;
}
def->format = value;
}
}

View File

@ -1502,7 +1502,7 @@ struct _virDomainAudioIOCommon {
unsigned int frequency;
unsigned int channels;
unsigned int voices;
int format; /* virDomainAudioFormat */
virDomainAudioFormat format;
unsigned int bufferLength; /* milliseconds */
};