wavcapture does not record silence

This bug has been copied automatically from: https://bugs.launchpad.net/qemu/+bug/1861692
Reported by 'Philippe Mathieu-Daudé' on 2020-02-03 :

Using setup described in https://bugs.launchpad.net/qemu/+bug/1861677 a
wav file is generated with all the silences stripped out. IOW silence
frames are not recorded.

Information from referenced Launchpad issue:

As of commit 28db64fc, using demo from QEMU advent calendar 2018 day 1: https://www.qemu-advent-calendar.org/2018/download/day01.tar.xz

$ qemu-system-x86_64 -M pc \
  -net none -soundhw pcspk \
  -drive file=day01/fbird.img,format=raw,if=floppy \
  -monitor stdio -S
(qemu) info qtree
bus: main-system-bus
  type System
  dev: i440FX-pcihost, id ""
    bus: pci.0
      dev: PIIX3, id ""
        bus: isa.0
          dev: isa-pcspk, id ""
            audiodev = "pa"
            iobase = 97 (0x61)
            migrate = true
(qemu) wavcapture out.wav pa
(qemu) cont
(qemu) # Press 'up' key in demo
Segmentation fault (core dumped)
Edited by John Snow