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

Fix crash due nullptr surface using DXVA2 #24085

Merged
merged 1 commit into from Nov 12, 2023
Merged

Conversation

fritsch
Copy link
Member

@fritsch fritsch commented Nov 11, 2023

This may happen when a stream starts with non I frame.

Follow-Up of: #24058

Reasoning:
Kodi will release Omega with version 6.0.1
6.0.1 for sure won't get this fix upstream, therefore we include it as shown here for windows (it's dxva2 anyways) only
Latest when bumping to the next ffmpeg version in Omega+1, we send the patch upstream again
Any input welcome with the focus on working user experience, means: What can we do so that Windows users can enjoy, especially LiveTV without crashes.

This may happen when a stream starts with non I frame.
@fritsch fritsch added Platform: Windows Type: Fix non-breaking change which fixes an issue v21 Omega labels Nov 11, 2023
@fritsch fritsch added this to the Omega 21.0 Beta 2 milestone Nov 11, 2023
Copy link
Contributor

@CrystalP CrystalP left a comment

Choose a reason for hiding this comment

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

Builds and works as expected, thank you!

@CrystalP
Copy link
Contributor

CrystalP commented Nov 11, 2023

Was there a reason for merge/reversal in ffmpeg?
The alternative of starting playback on an I frame doesn't sound bad, but maybe adds unreasonable delays for some streams? More risky at this stage of the release cycle.
How would one check the type of the first frame in the samples?

edit: actually can we even get a valid decoded picture until an I frame is reached?

@fritsch
Copy link
Member Author

fritsch commented Nov 12, 2023

Patch was forwarded by @garbear - Thank you very much!

jenkins build this please

@thexai
Copy link
Member

thexai commented Nov 12, 2023

How would one check the type of the first frame in the samples?

With VirtualDub:

Captura de pantalla 2023-11-12 092351

First frame is type P = predicted picture

Captura de pantalla 2023-11-12 092817

Fist key frame (I frame) is num 348 in this sample. VirtualDub uses [K] notation.

Anyway video is playable from first frame.

Note that P-frame definition is:

"P‑frames can use data from previous frames to decompress and are more compressible than I‑frames."

and not

"P‑frames must use data from previous frames to decompress and are more compressible than I‑frames."

Then probably in this sample first frame is signaled/flagged as type P but not uses data of previous frames and then can be used as key (I) frame.

@fritsch fritsch merged commit 0effeb2 into xbmc:master Nov 12, 2023
2 checks passed
@lrusak
Copy link
Contributor

lrusak commented Nov 12, 2023

Can you link the relevant ffmpeg mailing list discussion please?

@fritsch
Copy link
Member Author

fritsch commented Nov 12, 2023

@lrusak seems team Kodi colleagues agreed on a different path with the VLC ffmpeg people. I thought this is an alignment.

If it's not enough, I can post it on the ML. But I did not want to interfer with agreed best practices when I did not take part.

@garbear is this patch cooperation somewhere documented?

@garbear
Copy link
Member

garbear commented Nov 12, 2023

The documentation is called buy a plane ticket to VDD and hunt down ffmpeg devs until you find someone familiar with the code 🙂 as of now it's largely a one-way email thread that has mostly gone unanswered. Here's the list of patches we're trying to get eyes on:

https://github.com/xbmc/FFmpeg/commits/release/5.1-kodi

And now this one:

@fritsch
Copy link
Member Author

fritsch commented Nov 13, 2023

Thanks @garbear if there is sth I should do towards this upstreaming, do not hesitate to tell me. For the time in between I consider it as all fine.

Thanks very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants