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
This commit is contained in:
Arun Raghavan 2011-02-08 23:58:56 +05:30 committed by Stefan Kost
parent fe59f50468
commit e9ff48376b

View file

@ -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))