[vlc-devel] [PATCH 30/48] hls: Use time_t to store durations.

Hugo Beauzée-Luyssen beauze.h at gmail.com
Mon Jan 9 16:16:39 CET 2012


---
 modules/stream_filter/httplive.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index c40d281..8385c0d 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -67,7 +67,7 @@ vlc_module_end()
 typedef struct segment_s
 {
     int         sequence;   /* unique sequence number */
-    int         duration;   /* segment duration (seconds) */
+    time_t      duration;   /* segment duration (seconds) */
     uint64_t    size;       /* segment size in bytes */
 
     char       *uri;
@@ -84,7 +84,7 @@ typedef struct hls_stream_s
     int         id;         /* program id */
     int         version;    /* protocol version should be 1 */
     int         sequence;   /* media sequence number */
-    int         duration;   /* maximum duration per segment (s) */
+    time_t      duration;   /* maximum duration per segment (s) */
     uint64_t    bandwidth;  /* bandwidth usage of segments (bits per second)*/
     uint64_t    size;       /* stream length is calculated by taking the sum
                                foreach segment of (segment->duration * hls->bandwidth/8) */
@@ -387,7 +387,7 @@ static int ChooseSegment(stream_t *s, const int current)
 
         if (segment->duration > hls->duration)
         {
-            msg_Err(s, "EXTINF:%d duration is larger than EXT-X-TARGETDURATION:%d",
+            msg_Err(s, "EXTINF:%ld duration is larger than EXT-X-TARGETDURATION:%ld",
                     segment->duration, hls->duration);
         }
 
@@ -1252,7 +1252,7 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
             {
                 msg_Warn(s, "existing segment found with different content - resetting");
                 msg_Warn(s, "- sequence: new=%d, old=%d", p->sequence, segment->sequence);
-                msg_Warn(s, "- duration: new=%d, old=%d", p->duration, segment->duration);
+                msg_Warn(s, "- duration: new=%ld, old=%ld", p->duration, segment->duration);
                 msg_Warn(s, "- file: new=%s", p->uri );
                 msg_Warn(s, "        old=%s", segment->uri );
 
@@ -1451,7 +1451,7 @@ static int hls_DownloadSegmentData(stream_t *s, hls_stream_t *hls, segment_t *se
         int estimated = (int)(size / p_sys->bandwidth);
         if (estimated > segment->duration)
         {
-            msg_Warn(s,"downloading of segment %d takes %ds, which is longer than its playback (%ds)",
+            msg_Warn(s,"downloading of segment %d takes %ds, which is longer than its playback (%lds)",
                         segment->sequence, estimated, segment->duration);
         }
     }
-- 
1.7.8.3




More information about the vlc-devel mailing list