sync: handle very short streams better
authorJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 17 May 2016 20:57:07 +0000 (14:57 -0600)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 17 May 2016 20:57:07 +0000 (14:57 -0600)
If the entire stream fits in the sync queues, the first PTS was not
detected and initial offsets were not applied.

libhb/sync.c

index ca7a4063f62f2e52184acee4fe1f5b70e4de2265..69e6d18e455f28f007ee9aa2704953124c428dd8 100644 (file)
@@ -686,6 +686,10 @@ static void streamFlush( sync_stream_t * stream )
 {
     while (hb_list_count(stream->in_queue) > 0)
     {
+        if (!stream->common->found_first_pts)
+        {
+            checkFirstPts(stream->common);
+        }
         fixStreamTimestamps(stream);
         hb_buffer_t * buf = hb_list_item(stream->in_queue, 0);
         if (buf != NULL)