pytorch / torchcodec

PyTorch video decoding
BSD 3-Clause "New" or "Revised" License
83 stars 9 forks source link

Do not re-use old sws context if parameters have changed #354

Closed romanmeta closed 2 weeks ago

romanmeta commented 2 weeks ago

Summary: It is possible for a single video to have frames of different dimensions. Caching SwsContext across such frames results in all kinds of reliability issues (crashes, wrong data, etc.)

This diff makes sure that we only reuse cached SwsContext if the arguments to sws_getContext are the same.

Reviewed By: ahmadsharif1

Differential Revision: D65667262

facebook-github-bot commented 2 weeks ago

This pull request was exported from Phabricator. Differential Revision: D65667262

facebook-github-bot commented 2 weeks ago

This pull request was exported from Phabricator. Differential Revision: D65667262

facebook-github-bot commented 2 weeks ago

This pull request was exported from Phabricator. Differential Revision: D65667262

facebook-github-bot commented 2 weeks ago

This pull request was exported from Phabricator. Differential Revision: D65667262