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 ) ...@@ -375,8 +375,9 @@ static int FileControl( access_t *p_access, int i_query, va_list args )
{ {
struct stat st; struct stat st;
if (fstat (p_sys->fd, &st) == 0) if (fstat (p_sys->fd, &st))
p_sys->size = st.st_size; return VLC_EGENERIC;
p_sys->size = st.st_size;
*va_arg( args, uint64_t * ) = p_sys->size; *va_arg( args, uint64_t * ) = p_sys->size;
break; break;
} }
......
...@@ -242,7 +242,9 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -242,7 +242,9 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_SIZE: case ACCESS_GET_SIZE:
{ {
uint64_t *s = va_arg( args, uint64_t * ); 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; 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