mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
flac: Use new audio encoder/decoder base class API for srcpad caps
This commit is contained in:
parent
a6370cdb50
commit
161229a384
2 changed files with 3 additions and 7 deletions
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue