mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
Try to recover from decoding errors, use a hack(?) to make libmpeg2 not crash.
Original commit message from CVS: Try to recover from decoding errors, use a hack(?) to make libmpeg2 not crash.
This commit is contained in:
parent
9dfada637e
commit
4bd919792f
2 changed files with 9 additions and 4 deletions
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit 50879a63c4fa8f2544d4d89a9dbfa0f5720c3266
|
Subproject commit 0ce4bbf0bc51c08694a8a1e0bec7624094b043d6
|
|
@ -464,13 +464,16 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
|
||||||
GST_DEBUG (GST_CAT_CLOCK, "no pts");
|
GST_DEBUG (GST_CAT_CLOCK, "no pts");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_DEBUG (0, "calling _buffer");
|
||||||
mpeg2_buffer (mpeg2dec->decoder, data, end);
|
mpeg2_buffer (mpeg2dec->decoder, data, end);
|
||||||
|
GST_DEBUG (0, "calling _buffer done");
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
gboolean slice = FALSE;
|
gboolean slice = FALSE;
|
||||||
|
|
||||||
|
GST_DEBUG (0, "calling parse");
|
||||||
state = mpeg2_parse (mpeg2dec->decoder);
|
state = mpeg2_parse (mpeg2dec->decoder);
|
||||||
GST_DEBUG (0, "state %d", state);
|
GST_DEBUG (0, "parse state %d", state);
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case STATE_SEQUENCE:
|
case STATE_SEQUENCE:
|
||||||
{
|
{
|
||||||
|
@ -623,8 +626,10 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
|
||||||
break;
|
break;
|
||||||
/* error */
|
/* error */
|
||||||
case STATE_INVALID:
|
case STATE_INVALID:
|
||||||
gst_element_error (GST_ELEMENT (mpeg2dec), "decoding error");
|
g_warning ("mpeg2dec: decoding error");
|
||||||
done = TRUE;
|
/* it looks like setting a new frame in libmpeg2 avoids a crash */
|
||||||
|
/* FIXME figure out how this screws up sync and buffer leakage */
|
||||||
|
gst_mpeg2dec_alloc_buffer (mpeg2dec, info, GST_BUFFER_OFFSET (buf));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_warning ("%s: unhandled state %d, FIXME",
|
g_warning ("%s: unhandled state %d, FIXME",
|
||||||
|
|
Loading…
Reference in a new issue