dvdspu: Don't unmap an unreffed buffer
authorJan Schmidt <jan@centricular.com>
Mon, 25 Nov 2013 04:17:33 +0000 (15:17 +1100)
committerJan Schmidt <jan@centricular.com>
Mon, 25 Nov 2013 04:17:33 +0000 (15:17 +1100)
gst_dvd_spu_finish_spu_buf drops the reference to the current
buffer, so make sure to call gst_buffer_unmap before it.

gst/dvdspu/gstspu-vobsub.c

index 6e9f1dd..fa05d5b 100644 (file)
@@ -398,13 +398,14 @@ gstspu_vobsub_execute_event (GstDVDSpu * dvdspu)
   if (next_blk != state->vobsub.cur_cmd_blk) {
     /* Advance to the next block of commands */
     ret = gst_dvd_spu_setup_cmd_blk (dvdspu, next_blk, start, end);
+    gst_buffer_unmap (state->vobsub.buf, &map);
   } 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);
     ret = FALSE;
   }
-  gst_buffer_unmap (state->vobsub.buf, &map);
 
   return ret;
 }