diff options
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/Filtering.cpp | 3 | ||||
-rw-r--r-- | decoder/LAVVideo/stdafx.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/decoder/LAVVideo/Filtering.cpp b/decoder/LAVVideo/Filtering.cpp index 007a2890..d84bd37e 100644 --- a/decoder/LAVVideo/Filtering.cpp +++ b/decoder/LAVVideo/Filtering.cpp @@ -76,6 +76,9 @@ HRESULT CLAVVideo::Filter(LAVFrame *pFrame) m_pFilterGraph = avfilter_graph_alloc(); + av_opt_set(m_pFilterGraph, "thread_type", "slice", AV_OPT_SEARCH_CHILDREN); + av_opt_set_int(m_pFilterGraph, "threads", FFMAX(1, av_cpu_count() / 2), AV_OPT_SEARCH_CHILDREN); + _snprintf_s(args, sizeof(args), "video_size=%dx%d:pix_fmt=%s:time_base=1/10000000:pixel_aspect=1/1", pFrame->width, pFrame->height, av_get_pix_fmt_name(ff_pixfmt)); ret = avfilter_graph_create_filter(&m_pFilterBufferSrc, buffersrc, "in", args, NULL, m_pFilterGraph); if (ret < 0) { diff --git a/decoder/LAVVideo/stdafx.h b/decoder/LAVVideo/stdafx.h index e4f4221a..80d051e5 100644 --- a/decoder/LAVVideo/stdafx.h +++ b/decoder/LAVVideo/stdafx.h @@ -53,6 +53,7 @@ extern "C" { #include "libavfilter/buffersrc.h" #include "libavutil/intreadwrite.h" #include "libavutil/pixdesc.h" +#include "libavutil/opt.h" } #pragma warning(pop) |