Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdcfb309 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Don't create empty .wav files" into pi-dev

parents 150b9846 9e75663c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -3490,9 +3490,14 @@ void AudioFlinger::dumpTee(int fd, const sp<NBAIO_Source>& source, audio_io_hand
            // FIXME not big-endian safe
            write(teeFd, &temp, sizeof(temp));
            close(teeFd);
            // TODO Should create file with temporary name and then rename to final if non-empty.
            if (total > 0) {
                if (fd >= 0) {
                    dprintf(fd, "tee copied to %s\n", teePath);
                }
            } else {
                unlink(teePath);
            }
        } else {
            if (fd >= 0) {
                dprintf(fd, "unable to create tee %s: %s\n", teePath, strerror(errno));