diff options
author | René Stadler <mail@renestadler.de> | 2009-03-19 00:32:40 +0200 |
---|---|---|
committer | René Stadler <mail@renestadler.de> | 2009-03-23 20:57:15 +0200 |
commit | 3f90e6ff137d3e6e952b6c1550bd8a535d7fc391 (patch) | |
tree | 1813e0d3c7f570caa689bd3372204923bd8e44ac /gst/aacparse | |
parent | fcfc22f6f644227687614bb4cf71a6f63d52a1e9 (diff) | |
download | gst-plugins-bad-3f90e6ff137d3e6e952b6c1550bd8a535d7fc391.tar.gz gst-plugins-bad-3f90e6ff137d3e6e952b6c1550bd8a535d7fc391.tar.bz2 gst-plugins-bad-3f90e6ff137d3e6e952b6c1550bd8a535d7fc391.zip |
aacparse: Refactor check_valid_frame to expose broken code
Just moving code around and removing an unhelpful/misleading comment.
Diffstat (limited to 'gst/aacparse')
-rw-r--r-- | gst/aacparse/gstaacparse.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/gst/aacparse/gstaacparse.c b/gst/aacparse/gstaacparse.c index fdbcfb56..526e1c9d 100644 --- a/gst/aacparse/gstaacparse.c +++ b/gst/aacparse/gstaacparse.c @@ -585,7 +585,6 @@ gst_aacparse_check_valid_frame (GstBaseParse * parse, { const guint8 *data; GstAacParse *aacparse; - guint needed_data = 1024; gboolean ret = FALSE; aacparse = GST_AACPARSE (parse); @@ -601,22 +600,35 @@ gst_aacparse_check_valid_frame (GstBaseParse * parse, /* There is nothing to parse */ *framesize = GST_BUFFER_SIZE (buffer); ret = TRUE; - } - else if (aacparse->header_type == DSPAAC_HEADER_NOT_PARSED || + } else if (aacparse->header_type == DSPAAC_HEADER_NOT_PARSED || aacparse->sync == FALSE) { + ret = gst_aacparse_detect_stream (aacparse, data, GST_BUFFER_SIZE (buffer), framesize, skipsize); + + if (!ret) { + GST_DEBUG ("buffer didn't contain valid frame, skip = %d", *skipsize); + gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), 1024); + } + } else if (aacparse->header_type == DSPAAC_HEADER_ADTS) { + guint needed_data = 1024; + ret = gst_aacparse_check_adts_frame (aacparse, data, GST_BUFFER_SIZE (buffer), framesize, &needed_data); - } - if (!ret) { - /* Increase the block size, we want to find the header by ourselves */ - GST_DEBUG ("buffer didn't contain valid frame, skip = %d", *skipsize); - gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), needed_data); + if (!ret) { + GST_DEBUG ("buffer didn't contain valid frame"); + gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), + needed_data); + } + + } else { + GST_DEBUG ("buffer didn't contain valid frame"); + gst_base_parse_set_min_frame_size (GST_BASE_PARSE (aacparse), 1024); } + return ret; } |