mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
mxfdemux: Add helper function to convert MXFraction to gdouble and use it
This commit is contained in:
parent
8172830d47
commit
636b535e4a
3 changed files with 9 additions and 2 deletions
|
@ -2806,8 +2806,8 @@ void mxf_metadata_generic_sound_essence_descriptor_set_caps
|
|||
} else {
|
||||
gst_caps_set_simple (caps,
|
||||
"rate", G_TYPE_INT,
|
||||
(gint) ((((gdouble) self->audio_sampling_rate.n) /
|
||||
((gdouble) self->audio_sampling_rate.d)) + 0.5), NULL);
|
||||
(gint) (mxf_fraction_to_double (&self->audio_sampling_rate)
|
||||
+ 0.5), NULL);
|
||||
}
|
||||
|
||||
if (self->channel_count == 0) {
|
||||
|
|
|
@ -417,6 +417,12 @@ mxf_fraction_parse (MXFFraction * fraction, const guint8 * data, guint size)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
gdouble
|
||||
mxf_fraction_to_double (const MXFFraction * fraction)
|
||||
{
|
||||
return ((gdouble) fraction->n) / ((gdouble) fraction->d);
|
||||
}
|
||||
|
||||
gchar *
|
||||
mxf_utf16_to_utf8 (const guint8 * data, guint size)
|
||||
{
|
||||
|
|
|
@ -74,6 +74,7 @@ gboolean mxf_product_version_parse (MXFProductVersion * product_version,
|
|||
const guint8 * data, guint size);
|
||||
|
||||
gboolean mxf_fraction_parse (MXFFraction *fraction, const guint8 *data, guint size);
|
||||
gdouble mxf_fraction_to_double (const MXFFraction *fraction);
|
||||
|
||||
gboolean mxf_timestamp_parse (MXFTimestamp * timestamp, const guint8 * data, guint size);
|
||||
gboolean mxf_timestamp_is_unknown (const MXFTimestamp *a);
|
||||
|
|
Loading…
Reference in a new issue