diff options
author | Mark Nauwelaerts <mnauw@users.sourceforge.net> | 2013-11-23 14:35:06 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mnauw@users.sourceforge.net> | 2013-11-23 14:35:06 +0100 |
commit | db915754c15009dfe61bbc016b801f5bb63b1e84 (patch) | |
tree | 27a5304c8ce64b695bd68113b85ca3a8d586d89a | |
parent | fac0f1f668aaa5c39d4d64618c309ca3f732c28a (diff) |
dvdspu: pop new packet when invalid next command block
... to prevent staying stuck on current command block and busy looping.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=712219
-rw-r--r-- | gst/dvdspu/gstspu-vobsub.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gst/dvdspu/gstspu-vobsub.c b/gst/dvdspu/gstspu-vobsub.c index 2d2bb2902..6e9f1dd12 100644 --- a/gst/dvdspu/gstspu-vobsub.c +++ b/gst/dvdspu/gstspu-vobsub.c @@ -261,8 +261,10 @@ gst_dvd_spu_setup_cmd_blk (GstDVDSpu * dvdspu, guint16 cmd_blk_offset, guint16 delay; guint8 *cmd_blk = start + cmd_blk_offset; - if (G_UNLIKELY (cmd_blk + 5 >= end)) + if (G_UNLIKELY (cmd_blk + 5 >= end)) { + GST_DEBUG_OBJECT (dvdspu, "No valid command block"); return FALSE; /* No valid command block to read */ + } delay = GST_READ_UINT16_BE (cmd_blk); state->next_ts = state->vobsub.base_ts + STM_TO_GST (delay); @@ -368,6 +370,7 @@ gstspu_vobsub_execute_event (GstDVDSpu * dvdspu) guint8 *start, *cmd_blk, *end; guint16 next_blk; SpuState *state = &dvdspu->spu_state; + gboolean ret = TRUE; if (state->vobsub.buf == NULL) return FALSE; @@ -394,17 +397,16 @@ gstspu_vobsub_execute_event (GstDVDSpu * dvdspu) next_blk = GST_READ_UINT16_BE (cmd_blk + 2); if (next_blk != state->vobsub.cur_cmd_blk) { /* Advance to the next block of commands */ - gst_dvd_spu_setup_cmd_blk (dvdspu, next_blk, start, end); + ret = gst_dvd_spu_setup_cmd_blk (dvdspu, next_blk, start, end); } else { /* Next Block points to the current block, so we're finished with this * SPU buffer */ - gst_buffer_unmap (state->vobsub.buf, &map); gst_dvd_spu_finish_spu_buf (dvdspu); - return FALSE; + ret = FALSE; } gst_buffer_unmap (state->vobsub.buf, &map); - return TRUE; + return ret; } gboolean |