mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
aacparse: Reject raw AAC if no codec_data is found in the caps
If necessary, a demuxer will have to invent something here but this is only a problem with non-conformant files anyway.
This commit is contained in:
parent
df454fa28f
commit
fd261e1099
1 changed files with 14 additions and 5 deletions
|
@ -326,17 +326,26 @@ gst_aac_parse_sink_setcaps (GstBaseParse * parse, GstCaps * caps)
|
||||||
gst_aac_parse_set_src_caps (aacparse, caps);
|
gst_aac_parse_set_src_caps (aacparse, caps);
|
||||||
if (aacparse->header_type == aacparse->output_header_type)
|
if (aacparse->header_type == aacparse->output_header_type)
|
||||||
gst_base_parse_set_passthrough (parse, TRUE);
|
gst_base_parse_set_passthrough (parse, TRUE);
|
||||||
} else
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* caps info overrides */
|
/* caps info overrides */
|
||||||
gst_structure_get_int (structure, "rate", &aacparse->sample_rate);
|
gst_structure_get_int (structure, "rate", &aacparse->sample_rate);
|
||||||
gst_structure_get_int (structure, "channels", &aacparse->channels);
|
gst_structure_get_int (structure, "channels", &aacparse->channels);
|
||||||
} else {
|
} else {
|
||||||
aacparse->sample_rate = 0;
|
const gchar *stream_format =
|
||||||
aacparse->channels = 0;
|
gst_structure_get_string (structure, "stream-format");
|
||||||
aacparse->header_type = DSPAAC_HEADER_NOT_PARSED;
|
|
||||||
gst_base_parse_set_passthrough (parse, FALSE);
|
if (g_strcmp0 (stream_format, "raw") == 0) {
|
||||||
|
GST_ERROR_OBJECT (parse, "Need codec_data for raw AAC");
|
||||||
|
return FALSE;
|
||||||
|
} else {
|
||||||
|
aacparse->sample_rate = 0;
|
||||||
|
aacparse->channels = 0;
|
||||||
|
aacparse->header_type = DSPAAC_HEADER_NOT_PARSED;
|
||||||
|
gst_base_parse_set_passthrough (parse, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue