diff options
Diffstat (limited to 'video/rspng/src')
-rw-r--r-- | video/rspng/src/pngenc/imp.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/video/rspng/src/pngenc/imp.rs b/video/rspng/src/pngenc/imp.rs index 6d1829cda..dbe1e638e 100644 --- a/video/rspng/src/pngenc/imp.rs +++ b/video/rspng/src/pngenc/imp.rs @@ -124,8 +124,8 @@ impl State { gst_video::VideoFormat::Gray8 | gst_video::VideoFormat::Gray16Be => { png::ColorType::Grayscale } - gst_video::VideoFormat::Rgb => png::ColorType::RGB, - gst_video::VideoFormat::Rgba => png::ColorType::RGBA, + gst_video::VideoFormat::Rgb => png::ColorType::Rgb, + gst_video::VideoFormat::Rgba => png::ColorType::Rgba, _ => { gst_error!(CAT, "format is not supported yet"); unreachable!() @@ -333,6 +333,15 @@ impl VideoEncoderImpl for PngEncoder { let mut state_guard = self.state.lock(); let state = state_guard.as_mut().ok_or(gst::FlowError::NotNegotiated)?; + // FIXME: https://github.com/image-rs/image-png/issues/301 + { + let settings = self.settings.lock(); + state.reset(*settings).map_err(|err| { + err.log_with_object(element); + gst::FlowError::Error + })?; + } + gst_debug!( CAT, obj: element, |