[vlc-devel] commit: libvlc: Make sure calling get_duration() triggers preparsing and returns -1 if duration is unknown. (Pierre d' Herbemont )
git version control
git at videolan.org
Sat Jan 16 18:26:14 CET 2010
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Sat Jan 16 15:41:43 2010 +0100| [c6e4db8d938c5ed49ebbfd5e3cf4d1adfba4e1d7] | committer: Pierre d'Herbemont
libvlc: Make sure calling get_duration() triggers preparsing and returns -1 if duration is unknown.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c6e4db8d938c5ed49ebbfd5e3cf4d1adfba4e1d7
---
src/control/media.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/control/media.c b/src/control/media.c
index 940e420..abd19f5 100644
--- a/src/control/media.c
+++ b/src/control/media.c
@@ -592,6 +592,11 @@ libvlc_media_get_duration( libvlc_media_t * p_md, libvlc_exception_t *p_e )
return -1;
}
+ preparse_if_needed( p_md );
+
+ if (!input_item_IsPreparsed( p_md->p_input_item ))
+ return -1;
+
return input_item_GetDuration( p_md->p_input_item ) / 1000;
}
More information about the vlc-devel
mailing list