flac: Use new audio encoder/decoder base class API for srcpad caps

This commit is contained in:
Sebastian Dröge 2012-02-01 16:05:51 +01:00
parent a6370cdb50
commit 161229a384
2 changed files with 3 additions and 7 deletions

View file

@ -587,8 +587,6 @@ gst_flac_dec_write (GstFlacDec * flacdec, const FLAC__Frame * frame,
if (caps_changed
|| !gst_pad_has_current_caps (GST_AUDIO_DECODER_SRC_PAD (flacdec))) {
GstCaps *caps;
GST_DEBUG_OBJECT (flacdec, "Negotiating %d Hz @ %d channels", sample_rate,
channels);
@ -606,12 +604,10 @@ gst_flac_dec_write (GstFlacDec * flacdec, const FLAC__Frame * frame,
flacdec->info.position, channel_positions[flacdec->info.channels - 1],
flacdec->channel_reorder_map);
caps = gst_audio_info_to_caps (&flacdec->info);
flacdec->depth = depth;
gst_audio_decoder_set_outcaps (GST_AUDIO_DECODER (flacdec), caps);
gst_caps_unref (caps);
gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (flacdec),
&flacdec->info);
}
GST_LOG_OBJECT (flacdec, "alloc_buffer_and_set_caps");

View file

@ -724,7 +724,7 @@ gst_flac_enc_set_format (GstAudioEncoder * enc, GstAudioInfo * info)
"channels", G_TYPE_INT, GST_AUDIO_INFO_CHANNELS (info),
"rate", G_TYPE_INT, GST_AUDIO_INFO_RATE (info), NULL);
if (!gst_pad_set_caps (GST_AUDIO_ENCODER_SRC_PAD (enc), caps))
if (!gst_audio_encoder_set_output_format (enc, caps))
goto setting_src_caps_failed;
gst_caps_unref (caps);