mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
adpcmenc: Properly set output format
Otherwise this will just error out if we only set caps on the srcpad.
This commit is contained in:
parent
6ae2ee9880
commit
2d17cd62ef
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue