diff options
author | Artem Galin <[email protected]> | 2020-07-13 16:08:56 +0100 |
---|---|---|
committer | Scott <[email protected]> | 2020-07-20 16:56:43 +0100 |
commit | 8cfd3a28a61581f3a669cb41d82fd72399a50ce0 (patch) | |
tree | 7bd374a967d9a86920b3568ed5dcc78bef229448 | |
parent | bdee4bef65609aea9f56e0a87ad3d713f62033a7 (diff) |
qsv: fix gui issue with when av_frame is null
-rw-r--r-- | libhb/avfilter.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libhb/avfilter.c b/libhb/avfilter.c index 61de084b4..5b8b30d28 100644 --- a/libhb/avfilter.c +++ b/libhb/avfilter.c @@ -237,7 +237,8 @@ void hb_avfilter_alias_close( hb_filter_object_t * filter ) static hb_buffer_t* filterFrame( hb_filter_private_t * pv, hb_buffer_t * in ) { hb_buffer_list_t list; - hb_buffer_t * buf, * next; + hb_buffer_t * buf = NULL, * next = NULL; + int av_frame_is_not_null = 1; // TODO: find the reason for emply input av_frame for ffmpeg filters #if HB_PROJECT_FEATURE_QSV mfxFrameSurface1 *surface = NULL; // We need to keep surface pointer because hb_avfilter_add_buf set it to 0 after in ffmpeg call @@ -245,9 +246,16 @@ static hb_buffer_t* filterFrame( hb_filter_private_t * pv, hb_buffer_t * in ) { surface = (mfxFrameSurface1 *)in->qsv_details.frame->data[3]; } + else + { + av_frame_is_not_null= 0; + } #endif - hb_avfilter_add_buf(pv->graph, in); - buf = hb_avfilter_get_buf(pv->graph); + if (av_frame_is_not_null) + { + hb_avfilter_add_buf(pv->graph, in); + buf = hb_avfilter_get_buf(pv->graph); + } while (buf != NULL) { hb_buffer_list_append(&pv->list, buf); |