2 Commits

Author SHA1 Message Date
Tamas Csikel
629f647728 sf-ui 0.1.3: no app crash in FFmpeg decoders after a seek
All checks were successful
ci / test (push) Successful in 21m9s
With direct rendering on, gst-libav aborts the whole process
(g_error "video meta uses 864x480 instead of 854x480") when a padded
frame meets a renegotiation, for example after a seek or resume. Netflex
TV died this way on a Raspberry Pi 4 playing a 854x480 episode. The
player now turns direct rendering off on every avdec_* element it sets up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 17:02:48 +01:00
Tamas Csikel
cb37d872ed sf-ui 0.1.2: fix the video flicker
All checks were successful
ci / test (push) Successful in 20m59s
Glass's video fade stepped down whenever it was already at its target, so
a fully shown video dipped every other frame. At 60 fps that was a 5 %
dip; on a slow GPU (Raspberry Pi 4, ~10 fps during playback) the video
went down to ~60 % every other frame and the backdrop flickered through.
The fade now clamps to its target, like the picture fades do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 20:04:40 +01:00
4 changed files with 22 additions and 7 deletions

8
Cargo.lock generated
View File

@@ -4810,7 +4810,7 @@ dependencies = [
[[package]]
name = "sf-app"
version = "0.1.1"
version = "0.1.3"
dependencies = [
"anyhow",
"log",
@@ -4820,7 +4820,7 @@ dependencies = [
[[package]]
name = "sf-pack"
version = "0.1.1"
version = "0.1.3"
dependencies = [
"anyhow",
"ruzstd",
@@ -4832,7 +4832,7 @@ dependencies = [
[[package]]
name = "sf-ui"
version = "0.1.1"
version = "0.1.3"
dependencies = [
"anyhow",
"glow 0.16.0",
@@ -4848,7 +4848,7 @@ dependencies = [
[[package]]
name = "sf-ui-gallery"
version = "0.1.1"
version = "0.1.3"
dependencies = [
"anyhow",
"env_logger",

View File

@@ -5,7 +5,7 @@ members = ["sf-app", "sf-ui", "sf-ui/gallery", "sf-pack"]
exclude = ["templates/rust-app"]
[workspace.package]
version = "0.1.1"
version = "0.1.3"
edition = "2024"
license = "MIT"
repository = "https://gitea.bluefox.support/fennec/sdk"

View File

@@ -434,11 +434,14 @@ impl State {
keep
});
// Eases to the target and stays there. (It used to step down whenever
// it was already at the target: a fully shown video dipped every
// other frame, a visible flicker at a slow GPU's frame rate.)
let target = if self.video_on { 1.0 } else { 0.0 };
self.video_alpha = if target > self.video_alpha {
(self.video_alpha + dt / 0.3).min(1.0)
(self.video_alpha + dt / 0.3).min(target)
} else {
(self.video_alpha - dt / 0.3).max(0.0)
(self.video_alpha - dt / 0.3).max(target)
};
if !self.video_on && self.video_alpha <= 0.0 {
self.video = None;

View File

@@ -242,6 +242,18 @@ impl Player {
if !opts.subtitles {
set_flag(&playbin, "text", false);
}
// FFmpeg decoders: no direct rendering. With it, gst-libav aborts the
// whole app (g_error "video meta uses 864x480 instead of 854x480")
// when a padded frame meets a renegotiation, e.g. after a seek.
playbin.connect("element-setup", false, |args| {
if let Some(el) = args.get(1).and_then(|v| v.get::<gst::Element>().ok()) {
let is_avdec = el.factory().is_some_and(|f| f.name().starts_with("avdec_"));
if is_avdec && el.find_property("direct-rendering").is_some() {
el.set_property("direct-rendering", false);
}
}
None
});
if let Some(ua) = opts.user_agent.clone() {
playbin.connect("source-setup", false, move |args| {
if let Some(src) = args.get(1).and_then(|v| v.get::<gst::Element>().ok()) {