Commit 9f873743 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

access: ACCESS_GET_SIZE return an error if size is unknown

parent df3be99a
......@@ -375,8 +375,9 @@ static int FileControl( access_t *p_access, int i_query, va_list args )
{
struct stat st;
if (fstat (p_sys->fd, &st) == 0)
p_sys->size = st.st_size;
if (fstat (p_sys->fd, &st))
return VLC_EGENERIC;
p_sys->size = st.st_size;
*va_arg( args, uint64_t * ) = p_sys->size;
break;
}
......
......@@ -242,7 +242,9 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_SIZE:
{
uint64_t *s = va_arg( args, uint64_t * );
*s = p_sys->b_broadcast ? 0 : p_sys->asfh.i_file_size;
if (p_sys->b_broadcast)
return VLC_EGENERIC;
*s = p_sys->asfh.i_file_size;
return VLC_SUCCESS;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment