Commit e9ff4837 authored by Arun Raghavan's avatar Arun Raghavan Committed by Stefan Kost
Browse files

discoverer: Use nominal bitrate if bitrate tag is unavailable

If the bitrate tag is unavailable, this falls back to the nominal
bitrate tag instead, if that is present.

https://bugzilla.gnome.org/show_bug.cgi?id=641860
parent fe59f504
......@@ -598,7 +598,8 @@ collect_information (GstDiscoverer * dc, const GstStructure * st,
if (gst_structure_id_has_field (st, _TAGS_QUARK)) {
gst_structure_id_get (st, _TAGS_QUARK,
GST_TYPE_STRUCTURE, &tags_st, NULL);
if (gst_structure_get_uint (tags_st, GST_TAG_BITRATE, &utmp))
if (gst_structure_get_uint (tags_st, GST_TAG_BITRATE, &utmp) ||
gst_structure_get_uint (tags_st, GST_TAG_NOMINAL_BITRATE, &utmp))
info->bitrate = utmp;
if (gst_structure_get_uint (tags_st, GST_TAG_MAXIMUM_BITRATE, &utmp))
......@@ -650,7 +651,8 @@ collect_information (GstDiscoverer * dc, const GstStructure * st,
if (gst_structure_id_has_field (st, _TAGS_QUARK)) {
gst_structure_id_get (st, _TAGS_QUARK,
GST_TYPE_STRUCTURE, &tags_st, NULL);
if (gst_structure_get_uint (tags_st, GST_TAG_BITRATE, &utmp))
if (gst_structure_get_uint (tags_st, GST_TAG_BITRATE, &utmp) ||
gst_structure_get_uint (tags_st, GST_TAG_NOMINAL_BITRATE, &utmp))
info->bitrate = utmp;
if (gst_structure_get_uint (tags_st, GST_TAG_MAXIMUM_BITRATE, &utmp))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment