You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AkarinVS
changed the title
unable to return alpha frame in certain situations
LWLibavSource: unable to return alpha frame in certain situations
Sep 8, 2021
AkarinVS
changed the title
LWLibavSource: unable to return alpha frame in certain situations
LWLibavSource: unable to return alpha frame of ARGB png image if alpha frame is requested after the main content
Sep 8, 2021
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.
FixesAkarinVS/L-SMASH-Works#8.
Signed-off-by: akarin <[email protected]>
(cherry picked from commit AkarinVS/L-SMASH-Works@95138e2)
Using VS R54.
Given a png file (logo11.png) with transparency, this code fails with "
lsmas: failed to output a video frame.
" for the alpha clip:However, if we flip the condition of the if statement, it works.
Also, a test sample movie with alpha (RLE RGBA)
https://user-images.githubusercontent.com/79720032/132518447-659caa63-ce2d-4120-9f76-5700cfc7fcb6.mov
The text was updated successfully, but these errors were encountered: