Commit fac2760c authored by Stefan Doehla's avatar Stefan Doehla
Browse files

fix size for verification, hard-coded source 127.0.0.1:5000

parent 80ecaad9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ static bool readLong(
{
    char buffer[4] = { 0 };

    if ( fread( buffer, 1, 4, file ) != 1U )
    if ( fread( buffer, 1, 4, file ) != 4U )
    {
        return false;
    }
+13 −9
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ static unsigned char *parseByte( unsigned char *buffer, unsigned char *value )
static int readLong( FILE *file, unsigned int *value )
{
    char buffer[4] = { 0 };
    if ( fread( buffer, 1, 4, file ) != 1U )
    if ( fread( buffer, 1, 4, file ) != 4U )
    {
        return -1;
    }
@@ -96,7 +96,7 @@ static int readLong( FILE *file, unsigned int *value )
static int readShort( FILE *file, unsigned short *value )
{
    char buffer[2] = { 0 };
    if ( fread( buffer, 1, 2, file ) != 1U )
    if ( fread( buffer, 1, 2, file ) != 2U )
    {
        return -1;
    }
@@ -198,7 +198,10 @@ static int readHeader( struct RTPDUMP *hRTPDUMP )
static int writeHeader( struct RTPDUMP *hRTPDUMP )
{
    /* write rtpdump header */
    fprintf( hRTPDUMP->file, "#!rtpplay%s %s/%d\n", "1.0", "127.0.0.1", 5000 );
    {
        hRTPDUMP->source = 0x7F000001u; /* 127.0.0.1 */
        hRTPDUMP->port = 5000u;
        fprintf( hRTPDUMP->file, "#!rtpplay%s %s/%d\n", "1.0", "127.0.0.1", hRTPDUMP->port );
        if ( !writeLong( hRTPDUMP->file, hRTPDUMP->startSeconds ) &&
             !writeLong( hRTPDUMP->file, hRTPDUMP->startMicroSeconds ) &&
             !writeLong( hRTPDUMP->file, hRTPDUMP->source ) &&
@@ -207,6 +210,7 @@ static int writeHeader( struct RTPDUMP *hRTPDUMP )
        {
            return 0;
        }
    }
    return -1;
}