adpcmenc: Properly set output format

Otherwise this will just error out if we only set caps on the srcpad.
This commit is contained in:
Sebastian Dröge 2013-12-23 15:33:42 +01:00
parent 6ae2ee9880
commit 2d17cd62ef

View file

@ -142,6 +142,7 @@ adpcmenc_setup (ADPCMEnc * enc)
guint64 sample_bytes; guint64 sample_bytes;
const char *layout; const char *layout;
GstCaps *caps; GstCaps *caps;
gboolean ret;
switch (enc->layout) { switch (enc->layout) {
case LAYOUT_ADPCM_DVI: case LAYOUT_ADPCM_DVI:
@ -163,14 +164,14 @@ adpcmenc_setup (ADPCMEnc * enc)
"layout", G_TYPE_STRING, layout, "layout", G_TYPE_STRING, layout,
"block_align", G_TYPE_INT, enc->blocksize, NULL); "block_align", G_TYPE_INT, enc->blocksize, NULL);
gst_pad_set_caps (GST_AUDIO_ENCODER_SRC_PAD (enc), caps); ret = gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (enc), caps);
gst_caps_unref (caps); gst_caps_unref (caps);
/* Step index state is carried between blocks. */ /* Step index state is carried between blocks. */
enc->step_index[0] = 0; enc->step_index[0] = 0;
enc->step_index[1] = 0; enc->step_index[1] = 0;
return TRUE; return ret;
} }
static gboolean static gboolean