srctree

Andrew Kelley parent ee9523d6 5982b953
player: return an error when a song has 0 samples

player/root.zig added: 4, removed: 1, total 3
@@ -470,6 +470,9 @@ pub const File = struct {
 
assert(total_frames == channels[0].totalSamples());
 
if (total_frames == 0)
return error.EmptyStream;
 
var twi_encoder = Twi.Encoder.init;
try twi_encoder.setCapacity(gpa, waveform_image_width);
defer twi_encoder.deinit(gpa);