Skip to content

[BE] Resolve "Error reading ISM metadata files"

malenovsky requested to merge 786-error-reading-ism-metadata-files into main

Basic Info

Reason why this change is needed

The encoder crashes when reading past the last line of the ltv48_1ISM.csv or any other .csv metadata file.

Error (File read error) while reading ism metadata from: ./ltvISM1.csv

The crash can be reproduced with:

./IVAS_cod -ISM 1 ltvISM1.csv 13200 48 ltv48_MONO.wav bit

The reason is that the function feof() becomes true ONLY when reading past the end of data which doesn't occur in our codec due to the above error being raised.

Description of the change

This MR fixes the problem with a smarter logic around fgets() in combination with feof(). When the last line is read from the .csv file the file is rewound with the first line to be read again in the next frame.

Affected operating points

This change is BE at all operation points except for ISM input where short .csv (metadata) files are read from the command-line.

Edited by malenovsky

Merge request reports

Loading