summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-04-14 13:12:58 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-04-14 13:12:58 +0000
commit8b081dd1d412596b1e59a6e0f98bca8b0ac0950e (patch)
tree802b3188facff8293ca4aa559770ac1f9491c157
parent3091a399ebc5b2efad779d9cb82c2e4c9f013d26 (diff)
downloadgst-plugins-bad-8b081dd1d412596b1e59a6e0f98bca8b0ac0950e.tar.gz
gst-plugins-bad-8b081dd1d412596b1e59a6e0f98bca8b0ac0950e.tar.bz2
gst-plugins-bad-8b081dd1d412596b1e59a6e0f98bca8b0ac0950e.zip
ext/musepack/gstmusepackdec.c: Fix track/album peak tag values; use GST_DEBUG_FUNCPTR and gst_pad_new_from_static_tem...
Original commit message from CVS: * ext/musepack/gstmusepackdec.c: (gst_musepackdec_init), (gst_musepack_stream_init): Fix track/album peak tag values; use GST_DEBUG_FUNCPTR and gst_pad_new_from_static_template().
-rw-r--r--ChangeLog7
-rw-r--r--ext/musepack/gstmusepackdec.c24
2 files changed, 16 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 4abaadab..a3e50bd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-14 Tim-Philipp Müller <tim at centricular dot net>
+
+ * ext/musepack/gstmusepackdec.c: (gst_musepackdec_init),
+ (gst_musepack_stream_init):
+ Fix track/album peak tag values; use GST_DEBUG_FUNCPTR and
+ gst_pad_new_from_static_template().
+
2006-04-13 Edgard Lima <edgard.lima@indt.org.br>
* sys/v4l2/gstv4l2src.c: (gst_v4l2element_class_init),
diff --git a/ext/musepack/gstmusepackdec.c b/ext/musepack/gstmusepackdec.c
index d944fba1..8172aa8f 100644
--- a/ext/musepack/gstmusepackdec.c
+++ b/ext/musepack/gstmusepackdec.c
@@ -109,21 +109,16 @@ gst_musepackdec_init (GstMusepackDec * musepackdec, GstMusepackDecClass * klass)
musepackdec->d = g_new (mpc_decoder, 1);
musepackdec->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&sink_template),
- "sink");
- gst_element_add_pad (GST_ELEMENT (musepackdec), musepackdec->sinkpad);
-
+ gst_pad_new_from_static_template (&sink_template, "sink");
gst_pad_set_activate_function (musepackdec->sinkpad,
- gst_musepackdec_sink_activate);
+ GST_DEBUG_FUNCPTR (gst_musepackdec_sink_activate));
gst_pad_set_activatepull_function (musepackdec->sinkpad,
- gst_musepackdec_sink_activate_pull);
+ GST_DEBUG_FUNCPTR (gst_musepackdec_sink_activate_pull));
+ gst_element_add_pad (GST_ELEMENT (musepackdec), musepackdec->sinkpad);
- musepackdec->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get (&src_template),
- "src");
+ musepackdec->srcpad = gst_pad_new_from_static_template (&src_template, "src");
gst_pad_set_event_function (musepackdec->srcpad,
GST_DEBUG_FUNCPTR (gst_musepackdec_src_event));
-
gst_pad_set_query_function (musepackdec->srcpad,
GST_DEBUG_FUNCPTR (gst_musepackdec_src_query));
gst_pad_set_query_type_function (musepackdec->srcpad,
@@ -416,18 +411,17 @@ gst_musepack_stream_init (GstMusepackDec * musepackdec)
GST_TAG_BITRATE, (guint) i.average_bitrate, NULL);
}
- /* FIXME: are these values correct in the end? */
if (i.gain_title != 0 || i.gain_album != 0) {
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_GAIN, (gdouble) i.gain_title / 100.0,
GST_TAG_ALBUM_GAIN, (gdouble) i.gain_album / 100.0, NULL);
}
- /* FIXME: are these values correct in the end? */
- if (i.peak_title != 0 && i.peak_album != 0) {
+ if (i.peak_title != 0 && i.peak_title != 32767 &&
+ i.peak_album != 0 && i.peak_album != 32767) {
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
- GST_TAG_TRACK_PEAK, (gdouble) i.peak_title,
- GST_TAG_ALBUM_PEAK, (gdouble) i.peak_album, NULL);
+ GST_TAG_TRACK_PEAK, (gdouble) i.peak_title / 32767.0,
+ GST_TAG_ALBUM_PEAK, (gdouble) i.peak_album / 32767.0, NULL);
}
GST_LOG_OBJECT (musepackdec, "Posting tags: %" GST_PTR_FORMAT, tags);