[vlc-commits] prefetch: handle STREAM_GET_SIZE failure
Rémi Denis-Courmont
git at videolan.org
Thu Oct 22 21:45:24 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 22 22:19:07 2015 +0300| [dbc8b7819743e08a1602dbf3c07e945142a32f0f] | committer: Rémi Denis-Courmont
prefetch: handle STREAM_GET_SIZE failure
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dbc8b7819743e08a1602dbf3c07e945142a32f0f
---
modules/stream_filter/prefetch.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/stream_filter/prefetch.c b/modules/stream_filter/prefetch.c
index 16f102c..d7c34c7 100644
--- a/modules/stream_filter/prefetch.c
+++ b/modules/stream_filter/prefetch.c
@@ -374,6 +374,8 @@ static int Control(stream_t *stream, int query, va_list args)
case STREAM_IS_DIRECTORY:
return VLC_EGENERIC;
case STREAM_GET_SIZE:
+ if (sys->size == (uint64_t)-1)
+ return VLC_EGENERIC;
*va_arg(args, uint64_t *) = sys->size;
break;
case STREAM_GET_PTS_DELAY:
@@ -446,7 +448,8 @@ static int Open(vlc_object_t *obj)
stream_Control(stream->p_source, STREAM_CAN_SEEK, &sys->can_seek);
stream_Control(stream->p_source, STREAM_CAN_PAUSE, &sys->can_pause);
stream_Control(stream->p_source, STREAM_CAN_CONTROL_PACE, &sys->can_pace);
- stream_Control(stream->p_source, STREAM_GET_SIZE, &sys->size);
+ if (stream_Control(stream->p_source, STREAM_GET_SIZE, &sys->size))
+ sys->size = -1;
stream_Control(stream->p_source, STREAM_GET_PTS_DELAY, &sys->pts_delay);
if (stream_Control(stream->p_source, STREAM_GET_CONTENT_TYPE,
&sys->content_type))
More information about the vlc-commits
mailing list