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 if (caps_changed
|| !gst_pad_has_current_caps (GST_AUDIO_DECODER_SRC_PAD (flacdec))) { || !gst_pad_has_current_caps (GST_AUDIO_DECODER_SRC_PAD (flacdec))) {
GstCaps *caps;
GST_DEBUG_OBJECT (flacdec, "Negotiating %d Hz @ %d channels", sample_rate, GST_DEBUG_OBJECT (flacdec, "Negotiating %d Hz @ %d channels", sample_rate,
channels); 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->info.position, channel_positions[flacdec->info.channels - 1],
flacdec->channel_reorder_map); flacdec->channel_reorder_map);
caps = gst_audio_info_to_caps (&flacdec->info);
flacdec->depth = depth; flacdec->depth = depth;
gst_audio_decoder_set_outcaps (GST_AUDIO_DECODER (flacdec), caps); gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (flacdec),
gst_caps_unref (caps); &flacdec->info);
} }
GST_LOG_OBJECT (flacdec, "alloc_buffer_and_set_caps"); 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), "channels", G_TYPE_INT, GST_AUDIO_INFO_CHANNELS (info),
"rate", G_TYPE_INT, GST_AUDIO_INFO_RATE (info), NULL); "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; goto setting_src_caps_failed;
gst_caps_unref (caps); gst_caps_unref (caps);