ext/mad/gstmad.c: Don't call mad_stream_sync() directly after recovering sync.

Original commit message from CVS:
Reviewed by:  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
* ext/mad/gstmad.c: (gst_mad_chain):
Don't call mad_stream_sync() directly after recovering sync.
Fixes #151661.
This commit is contained in:
Ronald S. Bultje 2005-01-09 01:58:04 +00:00
parent f6caa6971e
commit d5257d4ea3
2 changed files with 31 additions and 15 deletions

View file

@ -1,3 +1,11 @@
2005-01-09 Francis Labonte <francis_labonte@hotmail.com>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/mad/gstmad.c: (gst_mad_chain):
Don't call mad_stream_sync() directly after recovering sync.
Fixes #151661.
2005-01-09 Martin Eikermann <meiker@upb.de>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>

View file

@ -1270,6 +1270,7 @@ gst_mad_chain (GstPad * pad, GstData * _data)
guint64 time_offset;
guint64 time_duration;
unsigned char const *before_sync, *after_sync;
gboolean resync = TRUE;
mad->in_error = FALSE;
@ -1329,6 +1330,9 @@ gst_mad_chain (GstPad * pad, GstData * _data)
* id3 tags, so we need to flush one byte less than the tagsize */
mad_stream_skip (&mad->stream, tagsize - 1);
/* When we skip, we don't want to call sync */
resync = FALSE;
tag = id3_tag_parse (data, tagsize);
if (tag) {
GstTagList *list;
@ -1350,7 +1354,9 @@ gst_mad_chain (GstPad * pad, GstData * _data)
}
}
}
//Should not sync here if mad_skip has been used before, the offset
//is "pending" inside mad and will be applied on next call to decode.
if (resync) {
mad_frame_mute (&mad->frame);
mad_synth_mute (&mad->synth);
before_sync = mad->stream.ptr.byte;
@ -1367,6 +1373,8 @@ gst_mad_chain (GstPad * pad, GstData * _data)
mad_stream_sync (&mad->stream);
/* recoverable errors pass */
}
goto next;
}