mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
aacparse: fix srcpad caps handling
This commit is contained in:
parent
78ed46cc4f
commit
3a095a26b2
1 changed files with 21 additions and 14 deletions
|
@ -878,9 +878,11 @@ gst_aac_parse_detect_stream (GstAacParse * aacparse,
|
||||||
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), 512);
|
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), 512);
|
||||||
|
|
||||||
/* arrange for metadata and get out of the way */
|
/* arrange for metadata and get out of the way */
|
||||||
sinkcaps = gst_pad_get_current_caps (GST_BASE_PARSE_SINK_PAD (aacparse));
|
if ((sinkcaps =
|
||||||
gst_aac_parse_set_src_caps (aacparse, sinkcaps);
|
gst_pad_get_current_caps (GST_BASE_PARSE_SINK_PAD (aacparse)))) {
|
||||||
gst_caps_unref (sinkcaps);
|
gst_aac_parse_set_src_caps (aacparse, sinkcaps);
|
||||||
|
gst_caps_unref (sinkcaps);
|
||||||
|
}
|
||||||
|
|
||||||
/* not syncable, not easily seekable (unless we push data from start */
|
/* not syncable, not easily seekable (unless we push data from start */
|
||||||
gst_base_parse_set_syncable (GST_BASE_PARSE_CAST (aacparse), FALSE);
|
gst_base_parse_set_syncable (GST_BASE_PARSE_CAST (aacparse), FALSE);
|
||||||
|
@ -1024,12 +1026,14 @@ gst_aac_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
||||||
aacparse->sample_rate = rate;
|
aacparse->sample_rate = rate;
|
||||||
aacparse->channels = channels;
|
aacparse->channels = channels;
|
||||||
|
|
||||||
sinkcaps = gst_pad_get_current_caps (GST_BASE_PARSE (aacparse)->sinkpad);
|
if ((sinkcaps =
|
||||||
if (!gst_aac_parse_set_src_caps (aacparse, sinkcaps)) {
|
gst_pad_get_current_caps (GST_BASE_PARSE (aacparse)->sinkpad))) {
|
||||||
/* If linking fails, we need to return appropriate error */
|
if (!gst_aac_parse_set_src_caps (aacparse, sinkcaps)) {
|
||||||
ret = GST_FLOW_NOT_LINKED;
|
/* If linking fails, we need to return appropriate error */
|
||||||
|
ret = GST_FLOW_NOT_LINKED;
|
||||||
|
}
|
||||||
|
gst_caps_unref (sinkcaps);
|
||||||
}
|
}
|
||||||
gst_caps_unref (sinkcaps);
|
|
||||||
|
|
||||||
gst_base_parse_set_frame_rate (GST_BASE_PARSE (aacparse),
|
gst_base_parse_set_frame_rate (GST_BASE_PARSE (aacparse),
|
||||||
aacparse->sample_rate, aacparse->frame_samples, 2, 2);
|
aacparse->sample_rate, aacparse->frame_samples, 2, 2);
|
||||||
|
@ -1059,13 +1063,16 @@ gst_aac_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
||||||
before knowing about rate/channels. */
|
before knowing about rate/channels. */
|
||||||
if (setcaps
|
if (setcaps
|
||||||
|| !gst_pad_has_current_caps (GST_BASE_PARSE_SRC_PAD (aacparse))) {
|
|| !gst_pad_has_current_caps (GST_BASE_PARSE_SRC_PAD (aacparse))) {
|
||||||
GstCaps *sinkcaps =
|
GstCaps *sinkcaps;
|
||||||
gst_pad_get_current_caps (GST_BASE_PARSE (aacparse)->sinkpad);
|
|
||||||
if (!gst_aac_parse_set_src_caps (aacparse, sinkcaps)) {
|
if ((sinkcaps =
|
||||||
/* If linking fails, we need to return appropriate error */
|
gst_pad_get_current_caps (GST_BASE_PARSE (aacparse)->sinkpad))) {
|
||||||
ret = GST_FLOW_NOT_LINKED;
|
if (!gst_aac_parse_set_src_caps (aacparse, sinkcaps)) {
|
||||||
|
/* If linking fails, we need to return appropriate error */
|
||||||
|
ret = GST_FLOW_NOT_LINKED;
|
||||||
|
}
|
||||||
|
gst_caps_unref (sinkcaps);
|
||||||
}
|
}
|
||||||
gst_caps_unref (sinkcaps);
|
|
||||||
|
|
||||||
gst_base_parse_set_frame_rate (GST_BASE_PARSE (aacparse),
|
gst_base_parse_set_frame_rate (GST_BASE_PARSE (aacparse),
|
||||||
aacparse->sample_rate, aacparse->frame_samples, 2, 2);
|
aacparse->sample_rate, aacparse->frame_samples, 2, 2);
|
||||||
|
|
Loading…
Reference in a new issue