Commit 1d069b8a authored by malenov's avatar malenov
Browse files

fix rewind() when reading past the last line of .csv metadata files

parent 006a21f5
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@
#define FIX_730_DPID_NOT_SET_CORRECTLY                  /* Eri: issue 730: write dpid read from file in correct index, print informative error message when DPID specified is not found. */

#define FIX_RAM_COUNTING_5MS_RENDERING                  /* FhG: fix for correct RAM reporting with 5ms rendering */
#define FIX_786_ERROR_ISM_METADATA_READ                 /* VA: fix error reading past the last line of .csv metadata files */

/* #################### End BE switches ################################## */

+14 −0
Original line number Diff line number Diff line
@@ -113,6 +113,19 @@ ivas_error IsmFileReader_readNextFrame(

    file = self->file;

#ifdef FIX_786_ERROR_ISM_METADATA_READ
    while ( fgets( char_buff, META_LINE_LENGTH, file ) == NULL )
    {
        if ( feof( self->file ) )
        {
            rewind( self->file );
        }
        else
        {
            return IVAS_ERR_FAILED_FILE_READ;
        }
    }
#else
    while ( feof( self->file ) )
    {
        rewind( self->file );
@@ -122,6 +135,7 @@ ivas_error IsmFileReader_readNextFrame(
    {
        return IVAS_ERR_FAILED_FILE_READ;
    }
#endif

    char_ptr = strtok( char_buff, "," );
    i = 0;