Commit graph

158 commits

Author SHA1 Message Date
Edward Hervey
21d2fffb13 mpegaudioparse: Fix stop condition for outputting buffers.
Some mp3 streams have an offset in timestamps, requiring us to push the
frame *AFTER* segment.stop in order for the decoder to be able to push
all data up to the segment.stop position.
2009-05-06 13:13:35 +02:00
Michael Smith
e7450c2df7 mp3parse: don't build seek table if we can't seek.
Fixes #573720 - unbounded memory usage increase when listening to mp3
stream for a long time.
2009-04-21 14:16:52 -07:00
Edward Hervey
8dcbcd6645 mpegaudioparse: Remove dead assignment and duplicate code 2009-04-21 20:37:20 +02:00
Jan Schmidt
d2c6f0b2b6 mp3parse: Fix glitches in the output when playing (for e.g.) AVI
Don't introduce glitches in the output by a) relaxing the threshold for
taking upstream timestamps in preference to our calculated timestamps and
b) only set the discont flag on outgoing buffers in response to an incoming
discont buffer.

Fixes: #575046
2009-03-13 19:25:12 +00:00
Alessandro Decina
abf7f47769 mp3parse: fix deadlock with accurate seeks.
Release pending_accurate_seeks_lock before forwarding the seek event upstream.
Fixes #575068.
2009-03-12 15:57:31 +01:00
Michael Smith
777eb4d9cc mp3parse: be more conservative when changing layer/rate/etc.
Don't allow a change in sample rate/channels/layer/version unless we can
see another frame at the correct offset. Prevents accidently flipping
due to simple single-bit corruption.
2009-03-06 13:21:36 -08:00
René Stadler
be6292d4de mpegaudioparse: Remove empty lines added by buggy indent. 2009-03-04 16:17:06 +02:00
Mark Nauwelaerts
d950699d2e mpegaudioparse: Provide SEEKING query handling.
Since SEEK event handling might perform some conversion
from TIME to BYTES, do not let upstream fool application
into (TIME) seeking not being possible.
2009-02-27 14:58:21 +01:00
Michael Smith
d61498d842 mp3parse: fix accurate seeks to near 0
Integer underflow made accurate seeks to near zero fail and seek to
completely the wrong place. Fix by clamping to zero, since we can't seek
to negative times anyway.
2009-02-25 13:34:05 -08:00
Tim-Philipp Müller
8c6bcd6771 gst/mpegaudioparse/gstmpegaudioparse.*: Do an initial class_ref on an internal enum type from within the class_init f...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c: (channel_mode_class),
(GST_TYPE_MP3_CHANNEL_MODE), (mp3_type_frame_length_from_header),
(gst_mp3parse_emit_frame), (mp3parse_get_query_types):
* gst/mpegaudioparse/gstmpegaudioparse.h:
Do an initial class_ref on an internal enum type from within the
class_init function so that there aren't any issues when multiple
mp3parse elements are started in separate threads at the same
time. (Why we use an enum type here if the tag is registered as
a string type, I don't know). Also remove custom UNUSED macro
and use GLib's instead.
2008-12-10 15:42:21 +00:00
Michael Smith
46c5294930 gst/mpegaudioparse/gstmpegaudioparse.c: Calculate samples per frame correctly for "MPEG 2.5" layer 3.
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
Calculate samples per frame correctly for "MPEG 2.5" layer 3.
Fixes skipping on these files.
2008-10-14 19:28:05 +00:00
Stefan Kost
793cdeb880 Don't install static libs for plugins. Fixes #550851 for ugly.
Original commit message from CVS:
* ext/a52dec/Makefile.am:
* ext/amrnb/Makefile.am:
* ext/cdio/Makefile.am:
* ext/dvdnav/Makefile.am:
* ext/dvdread/Makefile.am:
* ext/lame/Makefile.am:
* ext/mad/Makefile.am:
* ext/mpeg2dec/Makefile.am:
* ext/sidplay/Makefile.am:
* gst/ac3parse/Makefile.am:
* gst/asfdemux/Makefile.am:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdsub/Makefile.am:
* gst/iec958/Makefile.am:
* gst/mpegaudioparse/Makefile.am:
* gst/mpegstream/Makefile.am:
* gst/realmedia/Makefile.am:
* gst/synaesthesia/Makefile.am:
Don't install static libs for plugins. Fixes #550851 for ugly.
2008-10-13 18:10:25 +00:00
Sebastian Dröge
62d483656b gst/mpegaudioparse/gstmpegaudioparse.c: Post a GST_ELEMENT_ERROR if we get EOS before seeing any valid frames. Partia...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_sink_event):
Post a GST_ELEMENT_ERROR if we get EOS before seeing any valid
frames. Partially fixes bug #552237.
2008-10-13 09:04:15 +00:00
Sebastian Dröge
6d5dba30d2 gst/mpegaudioparse/gstmpegaudioparse.c: Don't recurse from mp3parse_bytepos_to_time() to mp3parse_total_time() if we'...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_sink_event), (gst_mp3parse_emit_frame),
(mp3parse_total_time), (mp3parse_bytepos_to_time):
Don't recurse from mp3parse_bytepos_to_time() to mp3parse_total_time()
if we're called from there already. Otherwise we end up in a endless
recursion and crash with a stack overflow.
This can happen when a Xing or VBRI header with TOC exists but it
doesn't contain the total time. Fixes bug #545370.
2008-07-31 14:35:40 +00:00
Sebastian Dröge
d2d56eb183 Put the MPEG audio version into the caps as "mpegaudioversion".
Original commit message from CVS:
* ext/lame/gstlame.c: (gst_lame_sink_setcaps):
* gst/mpegaudioparse/gstmpegaudioparse.c:
(mp3_type_frame_length_from_header), (mp3_caps_create),
(gst_mp3parse_chain):
Put the MPEG audio version into the caps as "mpegaudioversion".
This is different from "mpegversion".
2008-07-27 11:01:12 +00:00
Edward Hervey
8c0a922780 gst/mpegaudioparse/gstmpegaudioparse.c: Fix build on macosx.
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c: (head_check):
Fix build on macosx.
2008-06-26 10:40:03 +00:00
Stefan Kost
c49cf83ee3 Add missing elements to docs. Restore alphabetical order in section file. Document mad (it was included in docs alrea...
Original commit message from CVS:
* docs/plugins/gst-plugins-ugly-plugins-docs.sgml:
* docs/plugins/gst-plugins-ugly-plugins-sections.txt:
* ext/a52dec/gsta52dec.c:
* ext/amrnb/amrnbdec.c:
* ext/amrnb/amrnbenc.c:
* ext/amrnb/amrnbparse.c:
* ext/lame/gstlame.c:
* ext/mad/gstmad.c:
* ext/sidplay/gstsiddec.cc:
* gst/asfdemux/gstrtspwms.c:
* gst/mpegaudioparse/gstxingmux.c:
* gst/realmedia/rademux.c:
* gst/realmedia/rdtmanager.c:
* gst/realmedia/rtspreal.c:
* gst/synaesthesia/gstsynaesthesia.c:
Add missing elements to docs. Restore alphabetical order in section
file. Document mad (it was included in docs already).
Fix doc-markup: use convinience syntax for examples
(produces valid docbook), add several refsec2 when we have several
titles. Fix some types.
2008-06-13 06:57:21 +00:00
Stefan Kost
81e36c292e Do not use short_description in section docs for elements. We extract them from element details and there will be war...
Original commit message from CVS:
* ext/lame/gstlame.c:
* ext/sidplay/gstsiddec.cc:
* gst/mpegaudioparse/gstxingmux.c:
Do not use short_description in section docs for elements. We extract
them from element details and there will be warnings if they differ.
2008-06-13 05:52:17 +00:00
Sebastian Dröge
9838809d93 gst/mpegaudioparse/gstmpegaudioparse.c: Don't mark MPEG headers with emphasis == 0x2 as invalid. This emphasis value ...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c: (head_check):
Don't mark MPEG headers with emphasis == 0x2 as invalid. This
emphasis value is reserved but unfortunately files with that
value exist and the information is not important for the decoder
anyway. Fixes bug #537235.
2008-06-09 07:51:00 +00:00
Sebastian Dröge
916a018b60 gst/mpegaudioparse/gstxingmux.c: Fix alignment issues that caused SIGBUS on some architectures.
Original commit message from CVS:
* gst/mpegaudioparse/gstxingmux.c: (generate_xing_header):
Fix alignment issues that caused SIGBUS on some architectures.
2008-05-26 07:41:24 +00:00
Edward Hervey
130c46902a Always let FLUSH_START events flow downstream.
Original commit message from CVS:
* ext/mad/gstmad.c: (gst_mad_sink_event):
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_sink_event):
Always let FLUSH_START events flow downstream.
2008-05-10 00:44:00 +00:00
Sebastian Dröge
744d36d359 gst/mpegaudioparse/gstmpegaudioparse.c: Send a new duration message if the average bitrate changed and we don't know ...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Send a new duration message if the average bitrate changed and
we don't know the duration from the Xing or VBRI header.
Fixes bug #321857.
2008-05-05 08:43:38 +00:00
Julien Moutte
719b797ad0 gst/mpegaudioparse/gstxingmux.c: Fix argument formats.
Original commit message from CVS:
2008-04-11  Julien Moutte  <julien@fluendo.com>

* gst/mpegaudioparse/gstxingmux.c: (generate_xing_header): Fix
argument formats.
2008-04-11 08:09:55 +00:00
Sebastian Dröge
0815b78811 Depend on GLib 2.12 and use it unconditionally as we do in other modules too already.
Original commit message from CVS:
* configure.ac:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(mpeg_audio_seek_entry_free):
* gst/mpegaudioparse/gstxingmux.c: (gst_xing_seek_entry_free):
Depend on GLib 2.12 and use it unconditionally as we do in other
modules too already.
2008-04-04 19:04:20 +00:00
Sebastian Dröge
e6107e7b39 gst/mpegaudioparse/: Use GSlice for allocating the seek table entries if we compile with
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(mpeg_audio_seek_entry_new), (mpeg_audio_seek_entry_free),
(gst_mp3parse_reset), (gst_mp3parse_emit_frame):
* gst/mpegaudioparse/gstxingmux.c: (gst_xing_seek_entry_new),
(gst_xing_seek_entry_free), (gst_xing_mux_finalize), (xing_reset),
(gst_xing_mux_chain):
Use GSlice for allocating the seek table entries if we compile with
GLib 2.10 or newer.
2008-04-03 15:21:50 +00:00
Sebastian Dröge
62204cad3d gst/mpegaudioparse/gstmpegaudioparse.c: Don't take the stream lock when caching events. This is not necessary and res...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_sink_event):
Don't take the stream lock when caching events. This is not necessary
and results in a deadlock when seeking with rhythmbox (but not with
totem or banshee for some reason).
2008-03-12 16:09:48 +00:00
Wim Taymans
9142cfca7f gst/mpegaudioparse/gstmpegaudioparse.c: Remove trailing newlines from debug statements.
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_sink_event), (gst_mp3parse_chain):
Remove trailing newlines from debug statements.
2008-03-10 15:13:10 +00:00
Sebastian Dröge
71f6199a90 Push EOS, FLUSH_STOP and NEWSEGMENT immediately instead of dropping and leaking them.
Original commit message from CVS:
* ext/mad/gstmad.c: (gst_mad_sink_event):
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_sink_event):
Push EOS, FLUSH_STOP and NEWSEGMENT immediately instead
of dropping and leaking them.
2008-02-27 15:23:51 +00:00
Sebastian Dröge
b6529e9d60 Cache all events except EOS if we still have to send a NEWSEGMENT event. This will let TAG events be forwarded until ...
Original commit message from CVS:
* ext/mad/gstmad.c: (gst_mad_dispose), (gst_mad_sink_event),
(gst_mad_chain):
* ext/mad/gstmad.h:
* gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_dispose),
(gst_mp3parse_sink_event), (gst_mp3parse_emit_frame):
* gst/mpegaudioparse/gstmpegaudioparse.h:
Cache all events except EOS if we still have to send a NEWSEGMENT
event. This will let TAG events be forwarded until after decodebin
to an encoder for example as decodebin only links the pads
after NEWSEGMENT. Fixes bug #518933.
2008-02-27 13:18:57 +00:00
Sebastian Dröge
98577768ee gst/mpegaudioparse/gstxingmux.c: Write Xing header at the correct position in the MP3 frame for stereo files. Fixes b...
Original commit message from CVS:
* gst/mpegaudioparse/gstxingmux.c: (get_xing_offset):
Write Xing header at the correct position in the MP3 frame for
stereo files. Fixes bug #518676.
2008-02-27 12:48:41 +00:00
Thiago Sousa Santos
a07c914565 gst/mpegaudioparse/gstmpegaudioparse.*: Post channel mode and CRC as tags. Fixes bug #504493.
Original commit message from CVS:
Patch by: Thiago Sousa Santos <thiagoss at lcc dot ufcg dot edu dot br>
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3_channel_mode_get_type),
(mp3_type_frame_length_from_header), (gst_mp3parse_class_init),
(gst_mp3parse_reset), (gst_mp3parse_emit_frame),
(gst_mp3parse_chain):
* gst/mpegaudioparse/gstmpegaudioparse.h:
Post channel mode and CRC as tags. Fixes bug #504493.
2008-02-22 07:11:17 +00:00
Sebastian Dröge
14926b9c60 gst/mpegaudioparse/gstmpegaudioparse.c: Try a bit harder to get valid timestamps, especially if upstream gives us one...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame), (gst_mp3parse_chain):
Try a bit harder to get valid timestamps, especially if upstream
gives us one and we are at the first frame or resyncing.
Return UNEXPECTED if we get a valid timestamp that is outside of
our configured segment. After all changes done so far this doesn't
seem to cause any regression, please test.
2008-02-22 06:25:28 +00:00
Sebastian Dröge
2a179a3b1a gst/mpegaudioparse/gstmpegaudioparse.c: Handler buffers without valid timestamp more correctly: Don't drop them and d...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Handler buffers without valid timestamp more correctly: Don't drop
them and don't use the invalid timestamp to calculate the next
timestamp. Fixes bug #516811.
2008-02-18 10:25:16 +00:00
Jan Schmidt
a739f67bc2 gst/mpegaudioparse/gstmpegaudioparse.c: Revert previous commit to mp3parse, as it breaks playback of AVI files.
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
Revert previous commit to mp3parse, as it breaks playback
of AVI files.
2008-02-17 18:49:30 +00:00
Sebastian Dröge
451f53d7de gst/mpegaudioparse/gstmpegaudioparse.c: Return GST_FLOW_UNEXPECTED if we get data that is after our configured segmen...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_emit_frame):
Return GST_FLOW_UNEXPECTED if we get data that is after our
configured segment. This makes upstream go EOS immediately instead
of sending us the complete stream. Also improve debugging a bit.
2008-02-14 13:58:42 +00:00
Sebastian Dröge
17a6a7417c gst/mpegaudioparse/gstxingmux.c: Correctly write the size in bytes on big endian systems.
Original commit message from CVS:
* gst/mpegaudioparse/gstxingmux.c: (generate_xing_header):
Correctly write the size in bytes on big endian systems.
Fixes bug #515725.
2008-02-11 13:29:07 +00:00
Jan Schmidt
1e3d3da4a4 gst/mpegaudioparse/plugin.c: Commit new file I forgot to add.
Original commit message from CVS:
* gst/mpegaudioparse/plugin.c:
Commit new file I forgot to add.
2008-02-08 10:17:11 +00:00
Jan Schmidt
18df8e3250 Move xingmux from -bad.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-ugly-plugins-docs.sgml:
* docs/plugins/gst-plugins-ugly-plugins-sections.txt:
* docs/plugins/inspect/plugin-mpegaudioparse.xml:
* gst/mpegaudioparse/Makefile.am:
* gst/mpegaudioparse/gstmpegaudioparse.c:
* gst/mpegaudioparse/gstxingmux.c:
* tests/check/Makefile.am:
* tests/check/elements/.cvsignore:
Move xingmux from -bad.
2008-02-08 00:36:51 +00:00
Sébastien Moutte
c29660156f gst/mpegaudioparse/gstmpegaudioparse.c: Use gst_guint64_to_gdouble for conversion
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:(mp3parse_time_to_bytepos):
Use gst_guint64_to_gdouble for conversion
* win32/vs6/libgstasfdemux.dsp:
* win32/vs6/libgstdvdsub.dsp:
* win32/vs6/libgstrealmedia.dsp:
Update project dependencies and add new source files
2008-02-07 19:25:08 +00:00
Sebastian Dröge
0679293a71 gst/mpegaudioparse/gstmpegaudioparse.c: Don't set new caps on the srcpad everytime the bitrate or MPEG version change...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c: (mp3_caps_create),
(gst_mp3parse_chain):
Don't set new caps on the srcpad everytime the bitrate or MPEG
version changes but calculate new spf value when the MPEG version
changes.
2008-01-29 19:10:38 +00:00
Sebastian Dröge
bb56fbeed4 Add documentation for the xingheader plugin.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-bad-plugins-docs.sgml:
* docs/plugins/gst-plugins-bad-plugins-sections.txt:
* gst/xingheader/gstxingmux.c:
* gst/xingheader/gstxingmux.h:
Add documentation for the xingheader plugin.
* tests/check/elements/xingmux.c: (GST_START_TEST):
Set element state to PLAYING before doing something else.
2008-01-23 10:34:40 +00:00
Sebastian Dröge
79031308ad tests/check/: Add simple unit test for the xingmux element.
Original commit message from CVS:
* tests/check/Makefile.am:
* tests/check/elements/.cvsignore:
* tests/check/elements/xingmux.c: (setup_xingmux),
(cleanup_xingmux), (GST_START_TEST), (xingmux_suite), (main):
* tests/check/elements/xingmux_testdata.h:
Add simple unit test for the xingmux element.
* gst/xingheader/gstxingmux.c: (generate_xing_header),
(gst_xing_mux_finalize), (xing_reset):
Fix a memleak and invalid seek tables with less than 100 MP3 frames.
2008-01-23 10:11:44 +00:00
Sebastian Dröge
eecdae5af2 gst/mpegaudioparse/gstmpegaudioparse.c: Interpolate the VBRI seek table entries to get better results, support 3 byte...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_handle_first_frame), (mp3parse_time_to_bytepos),
(mp3parse_bytepos_to_time):
Interpolate the VBRI seek table entries to get better results,
support 3 byte seek table entries and prevent overflows in the
seek table by adding the relative offsets when using the seek
table in a large enough data type.
2008-01-15 17:18:31 +00:00
Sebastian Dröge
7b5d4c287e gst/mpegaudioparse/gstmpegaudioparse.*: Add support for seeking based on the VBRI seek table. Might make sense to use...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_reset),
(gst_mp3parse_handle_first_frame), (mp3parse_time_to_bytepos),
(mp3parse_bytepos_to_time):
* gst/mpegaudioparse/gstmpegaudioparse.h:
Add support for seeking based on the VBRI seek table. Might make
sense to use interpolation in the table later to get hopefully a
bit more accurate values.
2008-01-14 15:02:13 +00:00
Sebastian Dröge
790c1041e5 gst/xingheader/gstxingmux.c: Bitrate is 4 bits, not 8 so check for 0xe as maximum value instead of 0xfe.
Original commit message from CVS:
* gst/xingheader/gstxingmux.c: (generate_xing_header):
Bitrate is 4 bits, not 8 so check for 0xe as maximum value instead
of 0xfe.
2008-01-14 10:52:20 +00:00
Sebastian Dröge
be2f3d1d99 gst/mpegaudioparse/gstmpegaudioparse.*: Add initial support for reading VBRI headers as found in VBR files created by...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_reset),
(gst_mp3parse_emit_frame), (gst_mp3parse_handle_first_frame),
(mp3parse_total_bytes), (mp3parse_total_time):
* gst/mpegaudioparse/gstmpegaudioparse.h:
Add initial support for reading VBRI headers as found in VBR files
created by some Fraunhofer encoders. Currently we only read the
number of frames and bytes (and calculate duration, etc from this)
but there is also a seek table that we currently don't use.
2008-01-14 10:42:48 +00:00
Sebastian Dröge
1db9aa8d23 gst/mpegaudioparse/gstmpegaudioparse.c: Guard against 0 values in the Xing header as frame count and byte count and c...
Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c:
(gst_mp3parse_handle_first_frame):
Guard against 0 values in the Xing header as frame count and
byte count and calculate the bitrate when we have all values
we need and not before.
2008-01-14 09:13:29 +00:00
Sebastian Dröge
ec9cf651e2 gst/xingheader/gstxingmux.c: Remove accidentially leftover debug printf.
Original commit message from CVS:
* gst/xingheader/gstxingmux.c: (generate_xing_header):
Remove accidentially leftover debug printf.
2008-01-14 09:09:49 +00:00
Sebastian Dröge
20894aeda7 gst/xingheader/gstxingmux.c: Choose smallest possible frame size for the Xing header, properly set the timestamp, dur...
Original commit message from CVS:
* gst/xingheader/gstxingmux.c: (has_xing_header),
(generate_xing_header), (gst_xing_mux_chain),
(gst_xing_mux_sink_event):
Choose smallest possible frame size for the Xing header, properly
set the timestamp, duration and offset on the outgoing buffers,
only send NEWSEGMENT events in BYTE format downstream and also
drop VBRI headers if already existing.
2008-01-14 08:56:31 +00:00
Sebastian Dröge
50619d5741 gst/xingheader/: Major cleanup and rewrite of xingmux with less bugs and new features:
Original commit message from CVS:
* gst/xingheader/Makefile.am:
* gst/xingheader/gstxingmux.c: (parse_header), (get_xing_offset),
(has_xing_header), (generate_xing_header),
(gst_xing_mux_base_init), (gst_xing_mux_finalize), (xing_reset),
(gst_xing_mux_init), (gst_xing_mux_chain),
(gst_xing_mux_sink_event), (gst_xing_mux_change_state):
* gst/xingheader/gstxingmux.h:
Major cleanup and rewrite of xingmux with less bugs and new features:
- Handles other layers as 3
- Write TOC
2008-01-12 09:22:06 +00:00