From e9ff48376b04a5c3bd73c37bd37171a63282d6aa Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 8 Feb 2011 23:58:56 +0530 Subject: [PATCH] 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 --- gst-libs/gst/pbutils/gstdiscoverer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index 8422d8f..854fd46 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -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)) -- 2.7.4