X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=h264encode.cpp;h=913c8886ab52e22305d0cc0224887fac8365b38c;hb=302b3aa6582864f13376dacba98afebaf7591641;hp=9660a1afaf316bda61da4fda57608369f9faa139;hpb=e14cc21b5763ac38eea0c9ecc012d41872119e14;p=nageru diff --git a/h264encode.cpp b/h264encode.cpp index 9660a1a..913c888 100644 --- a/h264encode.cpp +++ b/h264encode.cpp @@ -924,7 +924,7 @@ int H264EncoderImpl::init_va(const string &va_display) if (support_encode == 0) { printf("Can't find VAEntrypointEncSlice for H264 profiles. If you are using a non-Intel GPU\n"); - printf("but have one in your system, try launching Nageru with --va-display /dev/dri/card0\n"); + printf("but have one in your system, try launching Nageru with --va-display /dev/dri/renderD128\n"); printf("to use VA-API against DRM instead of X11.\n"); exit(1); } else { @@ -1538,7 +1538,7 @@ void H264EncoderImpl::save_codeddata(storage_task task) pending_audio_frames.erase(it); } - AVFrame *frame = avcodec_alloc_frame(); + AVFrame *frame = av_frame_alloc(); frame->nb_samples = audio.size() / 2; frame->format = AV_SAMPLE_FMT_S32; frame->channel_layout = AV_CH_LAYOUT_STEREO; @@ -1570,7 +1570,7 @@ void H264EncoderImpl::save_codeddata(storage_task task) httpd->add_packet(pkt, audio_pts + global_delay, audio_pts + global_delay); } // TODO: Delayed frames. - avcodec_free_frame(&frame); + av_frame_unref(frame); av_free_packet(&pkt); if (audio_pts == task.pts) break; } @@ -1949,7 +1949,12 @@ void H264EncoderImpl::encode_frame(H264EncoderImpl::PendingFrame frame, int enco int frame_type, int64_t pts, int64_t dts) { // Wait for the GPU to be done with the frame. - glClientWaitSync(frame.fence.get(), 0, 0); + GLenum sync_status; + do { + sync_status = glClientWaitSync(frame.fence.get(), 0, 1000000000); + check_error(); + } while (sync_status == GL_TIMEOUT_EXPIRED); + assert(sync_status != GL_WAIT_FAILED); // Release back any input frames we needed to render this frame. frame.input_frames.clear();