X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mixer.cpp;h=79d8e97eb9b9391cda7ceaf2ad686719a9f00caf;hb=e066f18188fde1e6bd0b698c89427119cbffaaa3;hp=f7b6a7c90ea6c87ab5c090a1d5724398dbba4d70;hpb=a59184c5ad3126b439e11cf238c702680909b023;p=nageru diff --git a/mixer.cpp b/mixer.cpp index f7b6a7c..79d8e97 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -1000,8 +1000,9 @@ void Mixer::render_one_frame(int64_t duration) theme_main_chain.setup_chain(); //theme_main_chain.chain->enable_phase_timing(true); + const int64_t av_delay = lrint(global_flags.audio_queue_length_ms * 0.001 * TIMEBASE); // Corresponds to the delay in ResamplingQueue. GLuint y_tex, cbcr_tex; - bool got_frame = video_encoder->begin_frame(&y_tex, &cbcr_tex); + bool got_frame = video_encoder->begin_frame(pts_int + av_delay, duration, theme_main_chain.input_frames, &y_tex, &cbcr_tex); assert(got_frame); // Render main chain. @@ -1031,8 +1032,7 @@ void Mixer::render_one_frame(int64_t duration) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - const int64_t av_delay = lrint(global_flags.audio_queue_length_ms * 0.001 * TIMEBASE); // Corresponds to the delay in ResamplingQueue. - RefCountedGLsync fence = video_encoder->end_frame(pts_int + av_delay, duration, theme_main_chain.input_frames); + RefCountedGLsync fence = video_encoder->end_frame(); // The live frame just shows the RGBA texture we just rendered. // It owns rgba_tex now.