sf-ui 0.1.3: no app crash in FFmpeg decoders after a seek
All checks were successful
ci / test (push) Successful in 21m9s
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>
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user