Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VapourSynth/video_output.c: populate alpha make_frame functions earlier
lsmas used to relying on new_output_video_frame to call determine_colorspace_conversion to set vs_vohp->make_frame[output_index] for output_index 1 at get_frame time. However, the guard to determine_colorspace_conversion in new_output_video_frame is input argument input_pix_fmt_change, which does not take output_index into account. The end result is that, if the alpha frame is requested before the main clip frames, then new_output_video_frame notices that input_pix_fmt_change is true, and calls appropriate functions to set the make_frame function for the output_index 1. However, if the main clip frame is retrieved first, then new_output_video_frame will cal determine_colorspace_conversion for output_index 0, which sets results in the flag vshp->frame_prop_change_flags being cleared (as update_scaler_configuration_if_needed determined that vshp already matches av_frame's properties. You might wonder why does the code work if the request order is reversed (alpha first and then main)? Good question: it is because during vs_setup_video_rendering, determine_colorspace_conversion is already called for the main clip. To fix this convoluted mess, we make vs_setup_video_rendering also call determine_colorspace_conversion for output_index 1 (the alpha clip) as well. Fixes #8. Signed-off-by: akarin <[email protected]>
- Loading branch information