[vlc-devel] [PATCH 10/16] demux:asf: i_average_time_per_frame is an msftime_t

Steve Lhomme robux4 at ycbcr.xyz
Thu Jun 7 11:59:54 CEST 2018


---
 modules/demux/asf/asf.c    | 6 +++---
 modules/demux/asf/libasf.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 16c1117d04..c2aba4a679 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -317,9 +317,9 @@ static void WaitKeyframe( demux_t *p_demux )
         {
             /* 1 min if fastseek, otherwise 5 sec */
             /* That's a guess for bandwidth */
-            uint64_t i_maxwaittime = ( p_sys->b_canfastseek ) ? 600000000 : 50000000;
-            i_maxwaittime /= tk->info.p_esp->i_average_time_per_frame;
-            p_sys->i_wait_keyframe = __MIN( i_maxwaittime, UINT_MAX );
+            msftime_t i_maxwaittime = SEC_TO_MSFTIME( p_sys->b_canfastseek ? 60 : 5);
+            uint64_t frames = i_maxwaittime / tk->info.p_esp->i_average_time_per_frame;
+            p_sys->i_wait_keyframe = __MIN( frames, UINT_MAX );
         }
         else
         {
diff --git a/modules/demux/asf/libasf.h b/modules/demux/asf/libasf.h
index e35c21a0cf..9f2cb9f356 100644
--- a/modules/demux/asf/libasf.h
+++ b/modules/demux/asf/libasf.h
@@ -281,7 +281,7 @@ typedef struct
     uint32_t i_flags;
     uint16_t i_stream_number;
     uint16_t i_language_index;
-    uint64_t i_average_time_per_frame;
+    msftime_t i_average_time_per_frame;
 
     uint16_t i_stream_name_count;
 
-- 
2.17.0



More information about the vlc-devel mailing list