Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avcodec/decode: refactor hw_frame handling #2720

Merged
merged 3 commits into from
Oct 4, 2023
Merged

Conversation

sreimers
Copy link
Member

@sreimers sreimers commented Sep 14, 2023

With hardware decoding I had crashes after av_hwframe_transfer_data. It looks like a clean dst frame is needed and can not be reused with some hardware codecs.

With hardware decoding I had crashes after av_hwframe_transfer_data.
It looks like a fresh frame is needed and can not be reused with some
hardware codecs.
@sreimers sreimers changed the title avcodec/decode: refactor sw_frame handling avcodec/decode: refactor hw_frame handling Sep 14, 2023
frame->data[i] = st->pict->data[i];
frame->linesize[i] = st->pict->linesize[i];
frame->data[i] = sw_frame->data[i];
frame->linesize[i] = sw_frame->linesize[i];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please note that the frame memory has to be available after this function has returned,
because the vidframe is point to those data buffers ...

Copy link
Member Author

@sreimers sreimers Sep 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

av_free should only free the allocated AVFrame struct not the data itself I think.

@sreimers sreimers marked this pull request as ready for review October 3, 2023 10:02
@sreimers sreimers merged commit 176f0da into main Oct 4, 2023
18 checks passed
@sreimers sreimers deleted the av_hwframe_transfer_data branch October 4, 2023 06:54
sreimers added a commit that referenced this pull request Oct 5, 2023
sreimers added a commit that referenced this pull request Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants