gstreamer/datetime: Update for glib::DateTime API changes

This commit is contained in:
Sebastian Dröge 2020-12-24 12:46:27 +02:00
parent 60a5ccc95d
commit ec2a287842

View file

@ -296,10 +296,7 @@ impl DateTime {
// however, the resulting instance can't be translated to `glib::DateTime` // however, the resulting instance can't be translated to `glib::DateTime`
if self.has_second() { if self.has_second() {
self.to_g_date_time() self.to_g_date_time()
.and_then(|d| { .and_then(|d| d.to_utc())
d.to_utc()
.ok_or_else(|| glib::bool_error!("Can't convert datetime to UTC"))
})
.map(|d| d.into()) .map(|d| d.into())
} else { } else {
// It would be cheaper to build a `glib::DateTime` direcly, unfortunetaly // It would be cheaper to build a `glib::DateTime` direcly, unfortunetaly
@ -316,10 +313,7 @@ impl DateTime {
Some(0.0), Some(0.0),
) )
.and_then(|d| d.to_g_date_time()) .and_then(|d| d.to_g_date_time())
.and_then(|d| { .and_then(|d| d.to_utc())
d.to_utc()
.ok_or_else(|| glib::bool_error!("Can't convert datetime to UTC"))
})
.and_then(|d| { .and_then(|d| {
DateTime::new( DateTime::new(
None, // UTC TZ offset None, // UTC TZ offset