summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjep <jep@2b0047a9-a6d8-0310-accf-f7200b2a168c>2013-09-03 13:14:10 +0000
committerjep <jep@2b0047a9-a6d8-0310-accf-f7200b2a168c>2013-09-03 13:14:10 +0000
commitd0c9a441d776efe2317f84b5fc19042eff0a9e80 (patch)
tree9a612f9acc678387afbaaaf6a19e3a16f2b13393
parent40f404a371ed88c737df8966b4fc5216c4d635b5 (diff)
* src/flump3dec-1_0.c: (gst_flump3dec_parse):
* src/mp3tl.c: (mp3tl_gather_frame): For GStreamer 1.0 ensure to skip invalid frames like we do in GStreamer 0.10. Allows to play mp3 files with ID3 tags directly without confusing our decoder with mp3 sync codes in the ID3 data. git-svn-id: https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mp3@2501 2b0047a9-a6d8-0310-accf-f7200b2a168c
-rw-r--r--ChangeLog8
-rw-r--r--src/flump3dec-1_0.c2
-rw-r--r--src/mp3tl.c3
3 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f419d59..50fa73f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2013-09-03 Josep Torra <josep@fluendo.com>
+ * src/flump3dec-1_0.c: (gst_flump3dec_parse):
+ * src/mp3tl.c: (mp3tl_gather_frame):
+ For GStreamer 1.0 ensure to skip invalid frames like we do in
+ GStreamer 0.10. Allows to play mp3 files with ID3 tags directly
+ without confusing our decoder with mp3 sync codes in the ID3 data.
+
+2013-09-03 Josep Torra <josep@fluendo.com>
+
* src/bitstream.c: (bs_seek_sync):
Ensure not to read outside our buffer memory.
diff --git a/src/flump3dec-1_0.c b/src/flump3dec-1_0.c
index 3a66d60..f967646 100644
--- a/src/flump3dec-1_0.c
+++ b/src/flump3dec-1_0.c
@@ -81,6 +81,8 @@ gst_flump3dec_parse (GstAudioDecoder * base, GstAdapter * adapter,
gint avail;
const guint8 *data;
gboolean sync, eos;
+ *offset = 0;
+ *length = 0;
/* Give data to decoder */
avail = gst_adapter_available (adapter);
diff --git a/src/mp3tl.c b/src/mp3tl.c
index 27cabcc..1fe62dc 100644
--- a/src/mp3tl.c
+++ b/src/mp3tl.c
@@ -413,6 +413,9 @@ mp3tl_gather_frame (mp3tl * tl, gint * _offset, gint * _length)
*_offset = frame_start >> 3;
*_length = hdr->frame_bits >> 3;
tl->lost_sync = FALSE;
+ } else {
+ *_offset = (frame_start + SYNC_WORD_LNGTH) >> 3;
+ return MP3TL_ERR_NO_SYNC;
}
return MP3TL_ERR_OK;