gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1,
"layer", G_TYPE_INT, 3,
- "channels", G_TYPE_INT, lame->num_channels,
+ "channels", G_TYPE_INT, lame->mode == MONO ? 1 : lame->num_channels,
"rate", G_TYPE_INT, out_samplerate, NULL);
/* and use these caps */
if (size > 0 && lame->last_flow == GST_FLOW_OK) {
gint64 duration;
- duration = gst_util_uint64_scale_int (size, GST_SECOND,
- 2 * lame->samplerate * lame->num_channels);
+ duration = gst_util_uint64_scale_int (size, 8 * GST_SECOND,
+ 1000 * lame->bitrate);
if (lame->last_ts == GST_CLOCK_TIME_NONE) {
lame->last_ts = lame->eos_ts;