Commit 318841ac authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Loop playback for socket communication

parent 2af4f95c
Loading
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -2548,8 +2548,29 @@ static ivas_error decodeG192(
                {
                    if ( error == IVAS_ERR_END_OF_FILE )
                    {
#ifdef SOCKET_INTERFACE_FOR_POSE_AND_AUDIO
                        /* Rewind the input bitstream at the end of file in case of socket communication */
                        if ( arg.enableHeadrotTrajSocket )
                        {
                            if ( ( error = BS_Reader_Rewind( hBsReader ) ) != IVAS_ERR_OK )
                            {
                                fprintf( stderr, "\nError: unable to rewind input bitstream file: %s \n\n", arg.inputBitstreamFilename );
                                goto cleanup;
                            }
                            if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK )
                            {
                                fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename );
                                goto cleanup;
                            }
                        }
                        else
                        {
                            break;
                        }
#else
                        break;
#endif
                    }
                    fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename );
                    goto cleanup;
                }
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ cleanup:
    return error;
}

#ifdef DEBUGGING
#if defined( SOCKET_INTERFACE_FOR_POSE_AND_AUDIO ) || defined( DEBUGGING )
ivas_error BS_Reader_Rewind( BS_READER_HANDLE hBsReader )
{
    if ( hBsReader == NULL )
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ typedef struct BS_Reader *BS_READER_HANDLE;

ivas_error BS_Reader_Open_filename( BS_READER_HANDLE *phBsReader, const char *filename, BS_READER_FORMAT format );

#ifdef DEBUGGING
#if defined( SOCKET_INTERFACE_FOR_POSE_AND_AUDIO ) || defined( DEBUGGING )
ivas_error BS_Reader_Rewind( BS_READER_HANDLE hBsReader );
#endif