]> granicus.if.org Git - handbrake/commitdiff
Fix raw video timestamps
authorJohn Stebbins <jstebbins.hb@gmail.com>
Sun, 9 Apr 2017 16:33:26 +0000 (10:33 -0600)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Sun, 9 Apr 2017 16:33:26 +0000 (10:33 -0600)
Raw video has no timestamps. But we drop frames in sync that have no
timestamps.  So detect raw video and extrapolate timestamps from
framerate.

libhb/common.h
libhb/decavcodec.c
libhb/stream.c

index dc7ebb3ea47eda08573918ba1293224b3437e768..e6ef1270d62f2c5494a563e9e15b2a397af9e781 100644 (file)
@@ -1016,6 +1016,7 @@ struct hb_title_s
                 // set if video stream doesn't have IDR frames
 #define         HBTF_NO_IDR (1 << 0)
 #define         HBTF_SCAN_COMPLETE (1 << 1)
+#define         HBTF_RAW_VIDEO (1 << 2)
 
     // whether OpenCL scaling is supported for this source
     int             opencl_support;
index e038efd6dbb77d45e97d08b9998d175876317aba..7b94274e130cd085c9c43259f0699aae0b1696f4 100644 (file)
@@ -1425,6 +1425,8 @@ static int decavcodecvInit( hb_work_object_t * w, hb_job_t * job )
         pv->title = job->title;
     else
         pv->title = w->title;
+    if (pv->title->flags & HBTF_RAW_VIDEO)
+        pv->next_pts = 0;
     hb_buffer_list_clear(&pv->list);
 
 #ifdef USE_QSV
index baa53018f4f1c5ef734a4e611e18ff8826ba95f0..76d7fe4f3563deece922cb3afce2407898d8db26 100644 (file)
@@ -5554,6 +5554,10 @@ static hb_title_t *ffmpeg_title_scan( hb_stream_t *stream, hb_title_t *title )
 
             title->video_codec = WORK_DECAVCODECV;
             title->video_codec_param = codecpar->codec_id;
+            if (ic->iformat->raw_codec_id != AV_CODEC_ID_NONE)
+            {
+                title->flags |= HBTF_RAW_VIDEO;
+            }
         }
         else if (ic->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
                  avcodec_find_decoder( ic->streams[i]->codecpar->codec_id))