mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-10 19:25:26 +00:00
closedcaption: Update for deprecated chrono functions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/978>
This commit is contained in:
parent
3094bd96df
commit
bf9f7a747e
2 changed files with 18 additions and 15 deletions
|
@ -13,7 +13,7 @@ anyhow = "1"
|
||||||
nom = "7.0"
|
nom = "7.0"
|
||||||
either = "1"
|
either = "1"
|
||||||
uuid = { version = "1.0", features = ["v4"] }
|
uuid = { version = "1.0", features = ["v4"] }
|
||||||
chrono = "0.4"
|
chrono = "0.4.23"
|
||||||
once_cell = "1.0"
|
once_cell = "1.0"
|
||||||
atomic_refcell = "0.1"
|
atomic_refcell = "0.1"
|
||||||
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", features=["use_glib"] }
|
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", features=["use_glib"] }
|
||||||
|
|
|
@ -99,20 +99,23 @@ impl MccEnc {
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(ref creation_date) = settings.creation_date {
|
if let Some(ref creation_date) = settings.creation_date {
|
||||||
let creation_date = Utc
|
let creation_date =
|
||||||
.ymd(
|
FixedOffset::east_opt(creation_date.utc_offset().as_seconds() as i32)
|
||||||
creation_date.year() as i32,
|
.and_then(|tz| {
|
||||||
creation_date.month() as u32,
|
tz.with_ymd_and_hms(
|
||||||
creation_date.day_of_month() as u32,
|
creation_date.year() as i32,
|
||||||
)
|
creation_date.month() as u32,
|
||||||
.and_hms(
|
creation_date.day_of_month() as u32,
|
||||||
creation_date.hour() as u32,
|
creation_date.hour() as u32,
|
||||||
creation_date.minute() as u32,
|
creation_date.minute() as u32,
|
||||||
creation_date.seconds() as u32,
|
creation_date.seconds() as u32,
|
||||||
)
|
)
|
||||||
.with_timezone(&FixedOffset::east(
|
.latest()
|
||||||
creation_date.utc_offset().as_seconds() as i32
|
})
|
||||||
));
|
.ok_or_else(|| {
|
||||||
|
gst::error!(CAT, imp: self, "Invalid creation datetime");
|
||||||
|
gst::FlowError::Error
|
||||||
|
})?;
|
||||||
|
|
||||||
let _ = write!(
|
let _ = write!(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
Loading…
Reference in a new issue