diff options
author | John Stebbins <[email protected]> | 2017-04-09 10:33:26 -0600 |
---|---|---|
committer | John Stebbins <[email protected]> | 2017-04-09 10:33:26 -0600 |
commit | 3b080f5c7d5c1aa8ac80a37a8adb5db0a60b6aae (patch) | |
tree | 96e066b073c32dd086ef9f13290bbc77f28ec50a /libhb | |
parent | 44776e14258896fa651a8f7d4c8de3c94553caf2 (diff) |
Fix raw video timestamps
Raw video has no timestamps. But we drop frames in sync that have no
timestamps. So detect raw video and extrapolate timestamps from
framerate.
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.h | 1 | ||||
-rw-r--r-- | libhb/decavcodec.c | 2 | ||||
-rw-r--r-- | libhb/stream.c | 4 |
3 files changed, 7 insertions, 0 deletions
diff --git a/libhb/common.h b/libhb/common.h index dc7ebb3ea..e6ef1270d 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -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; diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index e038efd6d..7b94274e1 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -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 diff --git a/libhb/stream.c b/libhb/stream.c index baa53018f..76d7fe4f3 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -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)) |