mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
ext/vorbis/vorbisdec.c: Report bitrate.
Original commit message from CVS: * ext/vorbis/vorbisdec.c: (vorbis_handle_comment_packet): Report bitrate.
This commit is contained in:
parent
9449780dc3
commit
d8f417fbb7
2 changed files with 23 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-07-25 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* ext/vorbis/vorbisdec.c: (vorbis_handle_comment_packet):
|
||||
Report bitrate.
|
||||
|
||||
2005-07-25 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* gst/playback/gstplaybin.c: (gen_video_element),
|
||||
|
|
|
@ -401,6 +401,7 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
|
|||
static GstFlowReturn
|
||||
vorbis_handle_comment_packet (GstVorbisDec * vd, ogg_packet * packet)
|
||||
{
|
||||
guint bitrate = 0;
|
||||
gchar *encoder = NULL;
|
||||
GstMessage *message;
|
||||
GstTagList *list;
|
||||
|
@ -429,15 +430,27 @@ vorbis_handle_comment_packet (GstVorbisDec * vd, ogg_packet * packet)
|
|||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_ENCODER_VERSION, vd->vi.version,
|
||||
GST_TAG_AUDIO_CODEC, "Vorbis", NULL);
|
||||
if (vd->vi.bitrate_upper > 0)
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_MAXIMUM_BITRATE, (guint) vd->vi.bitrate_upper, NULL);
|
||||
if (vd->vi.bitrate_nominal > 0)
|
||||
if (vd->vi.bitrate_nominal > 0) {
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_NOMINAL_BITRATE, (guint) vd->vi.bitrate_nominal, NULL);
|
||||
if (vd->vi.bitrate_lower > 0)
|
||||
bitrate = vd->vi.bitrate_nominal;
|
||||
}
|
||||
if (vd->vi.bitrate_upper > 0) {
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_MAXIMUM_BITRATE, (guint) vd->vi.bitrate_upper, NULL);
|
||||
if (!bitrate)
|
||||
bitrate = vd->vi.bitrate_upper;
|
||||
}
|
||||
if (vd->vi.bitrate_lower > 0) {
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_MINIMUM_BITRATE, (guint) vd->vi.bitrate_lower, NULL);
|
||||
if (!bitrate)
|
||||
bitrate = vd->vi.bitrate_lower;
|
||||
}
|
||||
if (bitrate) {
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_BITRATE, (guint) bitrate, NULL);
|
||||
}
|
||||
|
||||
message = gst_message_new_tag ((GstObject *) vd, list);
|
||||
gst_element_post_message (GST_ELEMENT (vd), message);
|
||||
|
|
Loading…
Reference in a new issue