Skip to content

Commit

Permalink
CodecOpus
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Oct 29, 2023
1 parent d65d0df commit 4dc149e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/AudioCodecs/CodecOpus.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ struct OpusSettings : public AudioInfo {
bits_per_sample = 16;
}
int max_buffer_size = OPUS_DEC_MAX_BUFFER_SIZE;
int max_buffer_write_size = 512;

};

/**
Expand Down Expand Up @@ -200,9 +202,9 @@ class OpusAudioDecoder : public AudioDecoder {
int open = out_bytes;
int processed = 0;
while(open>0){
int to_write = std::min(open, 512);
int to_write = std::min(open, cfg.max_buffer_write_size);
int written = p_print->write(outbuf.data()+processed, to_write);
open -+ written;
open -= written;
processed += written;
}
}
Expand Down

0 comments on commit 4dc149e

Please sign in to comment.