Skip to content

Commit

Permalink
Merge pull request #3 from spicyjpeg/sector-size-fix
Browse files Browse the repository at this point in the history
Fix wrong output sector size in .STR encoder
  • Loading branch information
asiekierka authored Jun 26, 2023
2 parents d524746 + ecfdebc commit 306615b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions psxavenc/filefmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ void encode_file_xa(settings_t *settings, FILE *output) {
void encode_file_str(settings_t *settings, FILE *output) {
psx_audio_xa_settings_t xa_settings = settings_to_libpsxav_xa_audio(settings);
psx_audio_encoder_state_t audio_state;
int sector_size = psx_audio_xa_get_buffer_size_per_sector(xa_settings);
int audio_samples_per_sector;
uint8_t buffer[2352];

Expand Down Expand Up @@ -341,7 +342,7 @@ void encode_file_str(settings_t *settings, FILE *output) {
}
}

fwrite(buffer, 2352, 1, output);
fwrite(buffer, sector_size, 1, output);

time_t t = get_elapsed_time(settings);
if (t) {
Expand All @@ -363,7 +364,7 @@ void encode_file_sbs(settings_t *settings, FILE *output) {
settings->state_vid.frame_max_size = settings->alignment;
settings->state_vid.quant_scale_sum = 0;

for (int j = 0; ensure_av_data(settings, 0, 2); j++) {
for (int j = 0; ensure_av_data(settings, 0, 1); j++) {
encode_frame_bs(settings->video_frames, settings);
fwrite(settings->state_vid.frame_output, settings->alignment, 1, output);

Expand Down

0 comments on commit 306615b

Please sign in to comment.