From 5dead1c4007af753bb2895e9c44b2582b0b3ec3a Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 21 Feb 2012 18:49:50 +0100 Subject: [PATCH 1/3] mad: fixup unhacking last frame coaxing ... so as to not only replace the data pointer but also available size. --- ext/mad/gstmad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index 9b5f59734a..cd3d068ea8 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -300,10 +300,11 @@ gst_mad_parse (GstAudioDecoder * dec, GstAdapter * adapter, /* let's be nice and not mess with baseclass state and keep hacks local */ memset (GST_BUFFER_DATA (guard), 0, GST_BUFFER_SIZE (guard)); memcpy (GST_BUFFER_DATA (guard), data, av); - GST_DEBUG_OBJECT (mad, "Added %u zero guard bytes in the adapter; " + GST_DEBUG_OBJECT (mad, "added %u zero guard bytes in the adapter; " "using fallback buffer of size %u", GST_BUFFER_SIZE (guard) - av, GST_BUFFER_SIZE (guard)); data = GST_BUFFER_DATA (guard); + av = GST_BUFFER_SIZE (guard); } /* we basically let mad library do parsing, From 838493c9a7cc199805563299fc3152a0bdf3a77e Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 21 Feb 2012 18:53:57 +0100 Subject: [PATCH 2/3] mad: handle libmad freeform parsing quirk --- ext/mad/gstmad.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index cd3d068ea8..a24c89ddd0 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -339,6 +339,22 @@ gst_mad_parse (GstAudioDecoder * dec, GstAdapter * adapter, GST_LOG_OBJECT (mad, "decoding the header now"); if (mad_header_decode (&mad->frame.header, &mad->stream) == -1) { + /* HACK it seems mad reports wrong error when it is trying to determine + * free bitrate and scanning for next header */ + if (mad->stream.error == MAD_ERROR_LOSTSYNC) { + const guint8 *ptr = mad->stream.this_frame; + guint32 header; + + if (ptr >= data && ptr < data + av) { + header = GST_READ_UINT32_BE (ptr); + /* looks like possible freeform header with not much data */ + if (((header & 0xFFE00000) == 0xFFE00000) && + (((header >> 12) & 0xF) == 0x0) && (av < 4096)) { + GST_DEBUG_OBJECT (mad, "overriding freeform LOST_SYNC to BUFLEN"); + mad->stream.error = MAD_ERROR_BUFLEN; + } + } + } if (mad->stream.error == MAD_ERROR_BUFLEN) { GST_LOG_OBJECT (mad, "not enough data in tempbuffer (%d), breaking to get more", size); From 02f5d72a0519bcbe8f6958fab6dd998fc8ccda6b Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 21 Feb 2012 18:58:06 -0800 Subject: [PATCH 3/3] autogen.sh: avoid touching .po files during 'make' A simple workaround to deal with GNU gettext automake integration failing to deal with git. Fixes: #669207 --- autogen.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autogen.sh b/autogen.sh index 9a0ebde35b..c41ff0fea7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -29,6 +29,9 @@ then ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit fi +# GNU gettext automake support doesn't get along with git. +# https://bugzilla.gnome.org/show_bug.cgi?id=661128 +touch -t 200001010000 po/$package-0.10.pot CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'