Commit graph

23 commits

Author SHA1 Message Date
Sebastian Dröge
bfe54aff4b aacparse: Add function for the baseparse subclass to push buffers downstream
Also handle the case gracefully where the subclass decides to drop
the first buffers and has no caps set yet. It's still required to
have valid caps set when the first buffer should be passed downstream.
2011-04-08 18:06:58 +01:00
Sebastian Dröge
c83364ee81 baseparse: Fix seek event leaking 2011-04-08 18:06:58 +01:00
Mark Nauwelaerts
442ab41a05 aacparse: ADIF: do not send bogus timestamps, leave to downstream (decoder) 2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
92c80bc879 aacparse: fix sample rate extraction from codec data
In one case we extracted the sample rate index from the codec data
and saved it as sample rate rather than getting the real sample
rate from the table. Fix that, and also make sure we don't access
non-existant table entries by adding a small helper function that
guards against out-of-bounds access in case of invalid input data.
2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
c252137b82 aacparse, amrparse: remove bogus gst_pad_fixate_caps() calls 2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
e74776b3cb baseparse: propagate return value of GstBaseParse::set_sink_caps()
gst_base_parse_sink_setcaps() presumably should fail if the subclass
returns FALSE from its ::set_sink_caps() function.
2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
c59ee281ba baseparse: don't try to GST_LOG an already-freed caps string
The proper way to log caps is via GST_PTR_FORMAT anyway.
2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
fc09fe78af aacparse: set channels and rate on output caps, and keep codec_data
Create output caps from input caps, so we maintain any fields we
might get on the input caps, such as codec_data or rate and channels.
Set channels and rate on the output caps if we don't have input caps
or they don't contain such fields. We do this partly because we can,
but also because some muxers need this information. Tagreadbin will
also be happy about this.
2011-04-08 18:06:57 +01:00
Mark Nauwelaerts
debb9362ef baseparse: fix debug category 2011-04-08 18:06:57 +01:00
Mark Nauwelaerts
f5379229a0 baseparse: fix (regression in) newsegment handling
(aacparse, amrparse, flacparse).  Fixes #580133.
2011-04-08 18:06:57 +01:00
René Stadler
4b80afc22c baseparse: Fix slightly broken buffer-in-segment check (aacparse, amrparse, flacparse) 2011-04-08 18:06:57 +01:00
René Stadler
471bc5730a baseparse: Fix push mode seeking (aacparse, amrparse)
Sending the flush-start event forward before taking the stream lock actually
works, in contrast to deadlocking in downstream preroll_wait (hunk 1).

After that we get the chain function being stuck in a busy loop. This is fixed
by updating the minimum frame size inside the synchronization loop because the
subclass asks for more data in this way (hunk 2).

Finally, this leads to a very probable crash because the subclass can find a
valid frame with a size greater than the currently available data in the
adapter. This makes the subsequent gst_adapter_take_buffer call return NULL,
which is not expected (hunk 3).
2011-04-08 18:06:57 +01:00
Mark Nauwelaerts
4deaa95eda baseparse: Delay newsegment as long as possible.
If newsegment is sent (too) early, caps may not yet be fixed/set,
and downstream may not have been linked.
2011-04-08 18:06:57 +01:00
René Stadler
179632dc02 aacparse: Fix busyloop when seeking. Fixes #575388
The problem is that after a discont, set_min_frame_size(1024) is called when
detect_stream returns FALSE. However, detect_stream calls check_adts_frame
which sets the frame size on its own to something larger than 1024. This is the
same situation as in the beginning, so the base class ends up calling
check_valid_frame in an endless loop.
2011-04-08 18:06:57 +01:00
René Stadler
2856da8601 aacparse: Refactor check_valid_frame to expose broken code
Just moving code around and removing an unhelpful/misleading comment.
2011-04-08 18:06:57 +01:00
Stefan Kost
4ffb2499d3 baseparse: revert last change and properly fix
Baseparse internaly breaks the semantics of a _chain function by calling it with
buffer==NULL. The reson I belived it was okay to remove it was that there is
also an unchecked access to buffer later in _chain. Actually that code is wrong,
as it most probably wants to set discont on the outgoing buffer.
2011-04-08 18:06:57 +01:00
Stefan Kost
675dc650ca baseparse: remove checks for buffer==NULL
Accordifn to docs for GstPadChainFunction buffer cannot be NULL. If we would
leave the check, we would also need more such check below.
2011-04-08 18:06:57 +01:00
René Stadler
2bfa7bc456 aacparse: Fix license specified in plugin details. 2011-04-08 18:06:56 +01:00
Jan Schmidt
06f4cbd7f3 Fix the return value of the default parse_frame function.
Fix the return value of the default parse_frame function in both
copies of GstBaseParse
2011-04-08 18:06:56 +01:00
Stefan Kost
8b20a1d46f Log aac details found in codec_data. 2011-04-08 18:06:56 +01:00
Wim Taymans
76d9b6deaa gst/aacparse/gstaacparse.c: Don't autoplug aacparse until it works.
Original commit message from CVS:
* gst/aacparse/gstaacparse.c: (plugin_init):
Don't autoplug aacparse until it works.
2011-04-08 18:06:56 +01:00
Stefan Kost
16e3a36dc6 gst/: Fix baseparse type name.
Original commit message from CVS:
* gst/aacparse/gstbaseparse.c:
* gst/amrparse/gstbaseparse.c:
Fix baseparse type name.
2011-04-08 18:06:56 +01:00
Stefan Kost
fe9e6d3469 Add two new baseparse based parsers (aac and amr) from Bug #518857.
Original commit message from CVS:
* configure.ac:
* gst/aacparse/Makefile.am:
* gst/aacparse/gstaacparse.c:
* gst/aacparse/gstaacparse.h:
* gst/aacparse/gstbaseparse.c:
* gst/aacparse/gstbaseparse.h:
* gst/amrparse/Makefile.am:
* gst/amrparse/gstamrparse.c:
* gst/amrparse/gstamrparse.h:
* gst/amrparse/gstbaseparse.c:
* gst/amrparse/gstbaseparse.h:
Add two new baseparse based parsers (aac and amr) from Bug #518857.
2011-04-08 18:06:56 +01:00