- /* Next byte is the state. */
- block = bytestream_get_byte(&buf);;
- if (block == 0x80) {
- /*
- * Skip 7 bytes of unknown:
- * palette_update_flag (0x80),
- * palette_id_to_use,
- * Object Number (if > 0 determines if more data to process),
- * object_id_ref (2 bytes),
- * window_id_ref,
- * composition_flag (0x80 - object cropped, 0x40 - object forced)
- */
- buf += 7;
-
- x = bytestream_get_be16(&buf);
- y = bytestream_get_be16(&buf);
-
- /* TODO If cropping, cropping_x, cropping_y, cropping_width, cropping_height (all 2 bytes).*/
-
- dprintf(avctx, "Subtitle Placement x=%d, y=%d\n", x, y);
-
- if (x > ctx->presentation.video_w || y > ctx->presentation.video_h) {
- av_log(avctx, AV_LOG_ERROR, "Subtitle out of video bounds. x = %d, y = %d, video width = %d, video height = %d.\n",
- x, y, ctx->presentation.video_w, ctx->presentation.video_h);
- x = 0; y = 0;
- }
+ /*
+ * Skip 3 bytes of unknown:
+ * state
+ * palette_update_flag (0x80),
+ * palette_id_to_use,
+ */
+ buf += 3;
+
+ ctx->presentation.object_number = bytestream_get_byte(&buf);
+ if (!ctx->presentation.object_number)
+ return;
+
+ /*
+ * Skip 4 bytes of unknown:
+ * object_id_ref (2 bytes),
+ * window_id_ref,
+ * composition_flag (0x80 - object cropped, 0x40 - object forced)
+ */
+ buf += 4;