quickdesh / Animiru

Android app for anime
https://aniyomi.org/forks/Animiru/
Apache License 2.0
483 stars 11 forks source link

Remember and switch to the last used video codec(sw/hw+) option #66

Closed pjueon closed 7 months ago

pjueon commented 8 months ago

Describe your suggested feature

Other details

I'm using Animiru on Windows 11 by using WSA. On WSA, hw+ codec doesn't work(It's probably WSA issue). So I always have to switch the video codec to sw. In addition, switching to sw behavior is kind of unstable (it takes a few seconds and sometimes the app crashes). It would be really convenient if the video player remembers and automatically switches to the last used video codec.

Acknowledgements

abelmarkus commented 7 months ago

Same situation, WSA on windows 11, player stuck on HW+ but works in SW and HW mode. To me will be enough to change the default, I would set it to SW and that's it!

UPDATE: @pjueon I have found a working method!!

image

Please try it and tell me if video start in SW directly!

pjueon commented 7 months ago

@abelmarkus Thanks for the reply! I've just tried hwdec=auto-safe and hwdec=no, but it didn't work for me. It always starts with HW+.

I'm using the latest release version of Animiru with Nvidia graphic card.

pjueon commented 7 months ago

@abelmarkus I tried with my android phone, but even if I set 'hwdec=auto-safe' or 'hwdec=no', the player always starts with HW+. Is this working for you?

pjueon commented 7 months ago

I might be completely wrong because I don't know anything about kotlin or android apps, but it seems that this part of the code sets up the default codec settings.

https://github.com/Quickdesh/Animiru/blob/f5b05220ba9344a68e0637e007a1f7619da15043/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PlayerEnums.kt#L52-L75

To me will be enough to change the default, I would set it to SW and that's it!

To set the default codec setting, probably this part of the code should be changed. https://github.com/Quickdesh/Animiru/blob/f5b05220ba9344a68e0637e007a1f7619da15043/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PlayerEnums.kt#L64

pjueon commented 7 months ago

It would be great that the user can select the default decoder from settings, something like this:

Default decoder: [HW+], [HW], [SW], [Last used]

quickdesh commented 7 months ago

Has been updates to follow this schematic. You can find the HWcodec in the 3 dots sheet in the player