flacparse: Add maximum bitrate tag
authorCarlos Rafael Giani <dv@pseudoterminal.org>
Mon, 1 Aug 2016 16:52:26 +0000 (18:52 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 2 Aug 2016 11:34:54 +0000 (14:34 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=769392

gst/audioparsers/gstflacparse.c

index 4a36137..f405098 100644 (file)
@@ -1705,6 +1705,13 @@ gst_flac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
         GST_TAG_AUDIO_CODEC, caps);
     gst_caps_unref (caps);
 
+    /* Compute the bitrate of the uncompressed audio and set it as the
+     * maximum possible bitrate, since such a bitrate is the worst case
+     * (= no compression). */
+    gst_tag_list_add (flacparse->tags, GST_TAG_MERGE_KEEP,
+        GST_TAG_MAXIMUM_BITRATE, flacparse->samplerate * flacparse->bps *
+        flacparse->channels, NULL);
+
     /* Announce our pending tags */
     gst_base_parse_merge_tags (parse, flacparse->tags, GST_TAG_MERGE_REPLACE);