From 0431d015f4eda87ab4f024e713aae621ceaabb57 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Mon, 26 Sep 2011 12:07:15 +0200 Subject: [PATCH] twolame: improve output framing and timestamping ... which simply comes down to requesting one frame of input data at a time, since the encoder nicely turns this into 1 encoded frame. --- ext/twolame/gsttwolame.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/twolame/gsttwolame.c b/ext/twolame/gsttwolame.c index 3006f1a..bc2c07c 100644 --- a/ext/twolame/gsttwolame.c +++ b/ext/twolame/gsttwolame.c @@ -401,8 +401,12 @@ gst_two_lame_set_format (GstAudioEncoder * enc, GstAudioInfo * info) gst_pad_set_caps (GST_AUDIO_ENCODER_SRC_PAD (twolame), othercaps); gst_caps_unref (othercaps); - /* not much base class feedback: - * - we will handle buffers, just hand us all available */ + /* report needs to base class: + * hand one frame at a time, if we are pretty sure what a frame is */ + if (out_samplerate == twolame->samplerate) { + gst_audio_encoder_set_frame_samples (enc, 1152); + gst_audio_encoder_set_frame_max (enc, 1); + } return TRUE; -- 2.7.4