Skip to content

Commit

Permalink
render: use a more comprehensive boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
Ichunjo committed Oct 21, 2021
1 parent 361f80b commit 10e3163
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lvsfunc/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ def cb(f: Future[vs.AudioFrame], n: int) -> None:

if header == WaveHeader.AUTO:
conditions = (audio.num_channels > 2, audio.bits_per_sample > 16, audio.num_samples > 44100)
header_func, use_w64 = (_w64_header, 1) if any(conditions) else (_wav_header, 0)
header_func, use_w64 = (_w64_header, WaveHeader.WAVE64) if any(conditions) else (_wav_header, WaveHeader.WAVE)
else:
use_w64 = int(header)
use_w64 = header
header_func = (_wav_header, _w64_header)[header]

outfile.write(header_func(audio, bytes_per_second, block_align, data_size))
Expand Down Expand Up @@ -417,9 +417,6 @@ def _w64_header(audio: vs.AudioNode, bps: int, block_align: int, data_size: int)
header += struct.pack('<Q', len(fmt_guid) + 8 + len(fmt_chunk_data))
header += fmt_chunk_data

# # Finally write the header
# outfile.write(header)

# DATA-GUID
data_uuid = bytes(WAVE64_DATA_UUID)
header += data_uuid
Expand Down

0 comments on commit 10e3163

Please sign in to comment.