From 161229a38406654ec7f06fcb6f3f082574b4afc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 Feb 2012 16:05:51 +0100 Subject: [PATCH] flac: Use new audio encoder/decoder base class API for srcpad caps --- ext/flac/gstflacdec.c | 8 ++------ ext/flac/gstflacenc.c | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 3cba558d74..b2b93d640f 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -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"); diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c index 49b69e8b5e..cbd8f2df29 100644 --- a/ext/flac/gstflacenc.c +++ b/ext/flac/gstflacenc.c @@ -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);