diff options
Diffstat (limited to 'src/gallium/state_trackers/va/surface.c')
-rw-r--r-- | src/gallium/state_trackers/va/surface.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c index 636505b720e..9823232413f 100644 --- a/src/gallium/state_trackers/va/surface.c +++ b/src/gallium/state_trackers/va/surface.c @@ -36,6 +36,7 @@ #include "util/u_rect.h" #include "util/u_sampler.h" #include "util/u_surface.h" +#include "util/u_video.h" #include "vl/vl_compositor.h" #include "vl/vl_video_buffer.h" @@ -122,16 +123,18 @@ vlVaSyncSurface(VADriverContextP ctx, VASurfaceID render_target) } if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) { - int frame_diff; - if (context->desc.h264enc.frame_num_cnt >= surf->frame_num_cnt) - frame_diff = context->desc.h264enc.frame_num_cnt - surf->frame_num_cnt; - else - frame_diff = 0xFFFFFFFF - surf->frame_num_cnt + 1 + context->desc.h264enc.frame_num_cnt; - if ((frame_diff == 0) && - (surf->force_flushed == false) && - (context->desc.h264enc.frame_num_cnt % 2 != 0)) { - context->decoder->flush(context->decoder); - context->first_single_submitted = true; + if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC) { + int frame_diff; + if (context->desc.h264enc.frame_num_cnt >= surf->frame_num_cnt) + frame_diff = context->desc.h264enc.frame_num_cnt - surf->frame_num_cnt; + else + frame_diff = 0xFFFFFFFF - surf->frame_num_cnt + 1 + context->desc.h264enc.frame_num_cnt; + if ((frame_diff == 0) && + (surf->force_flushed == false) && + (context->desc.h264enc.frame_num_cnt % 2 != 0)) { + context->decoder->flush(context->decoder); + context->first_single_submitted = true; + } } context->decoder->get_feedback(context->decoder, surf->feedback, &(surf->coded_buf->coded_size)); surf->feedback = NULL; |