[vlc-commits] stream: allow STREAM_GET_SIZE to fail

Rémi Denis-Courmont git at videolan.org
Fri Jul 24 15:21:56 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jul 24 16:04:12 2015 +0300| [41683dae63e653bfe6f78e93446d64f5f4e35196] | committer: Rémi Denis-Courmont

stream: allow STREAM_GET_SIZE to fail

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=41683dae63e653bfe6f78e93446d64f5f4e35196
---

 include/vlc_stream.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/vlc_stream.h b/include/vlc_stream.h
index d74b817..1b088de 100644
--- a/include/vlc_stream.h
+++ b/include/vlc_stream.h
@@ -89,7 +89,7 @@ enum stream_query_e
     STREAM_SET_POSITION,        /**< arg1= uint64_t       res=can fail  */
     STREAM_GET_POSITION,        /**< arg1= uint64_t *     res=cannot fail*/
 
-    STREAM_GET_SIZE,            /**< arg1= uint64_t *     res=cannot fail (0 if no sense)*/
+    STREAM_GET_SIZE,            /**< arg1= uint64_t *     res=can fail */
 
     /* */
     STREAM_GET_PTS_DELAY = 0x101,/**< arg1= int64_t* res=cannot fail */
@@ -139,7 +139,9 @@ static inline int64_t stream_Tell( stream_t *s )
 static inline int64_t stream_Size( stream_t *s )
 {
     uint64_t i_pos;
-    stream_Control( s, STREAM_GET_SIZE, &i_pos );
+
+    if( stream_Control( s, STREAM_GET_SIZE, &i_pos ) )
+        i_pos = 0;
     if( i_pos >> 62 )
         return (int64_t)1 << 62;
     return i_pos;



More information about the vlc-commits mailing list