external/libwebmdec/test/test.c
static long file_length(void *opaque)
{
    FILE *f = (FILE *)opaque;
    const long saved_offset = ftell(f);
    if (fseek(f, 0, SEEK_END) != 0) {
        return -1;
    }
    const long length = ftell(f);
    if (fseek(f, saved_offset, SEEK_SET) != 0) {
        return -1;
    }
    return length;
}
/*
 * These are identical to the stdio callbacks used by webmdec_open_with_file().
 * We copy them here so we can use them regardless of whether stdio support
 * is compiled into the library.
 */
These are identical to the stdio callbacks used by webmdec_open_with_file().
We copy them here so we can use them regardless of whether stdio support
is compiled into the library.
These are identical to the stdio callbacks used by webmdec_open_with_file () . We copy them here so we can use them regardless of whether stdio support is compiled into the library .
static long file_length(void *opaque)
{
    FILE *f = (FILE *)opaque;
    const long saved_offset = ftell(f);
    if (fseek(f, 0, SEEK_END) != 0) {
        return -1;
    }
    const long length = ftell(f);
    if (fseek(f, saved_offset, SEEK_SET) != 0) {
        return -1;
    }
    return length;
}
static long file_length ( void * opaque ) { FILE * f = ( FILE * ) opaque ; const long saved_offset = ftell ( f ) ; if ( fseek ( f , 0 , SEEK_END ) != 0 ) { return -1 ; } const long length = ftell ( f ) ; if ( fseek ( f , saved_offset , SEEK_SET ) != 0 ) { return -1 ; } return length ; }
These are identical to the stdio callbacks used by webmdec_open_with_file().
These are identical to the stdio callbacks used by webmdec_open_with_file () .