meta: define invalid cursor metadata

This commit is contained in:
Wim Taymans 2018-11-30 12:08:53 +01:00
parent cd53eca92b
commit 218fd081df
2 changed files with 3 additions and 2 deletions

View file

@ -100,7 +100,7 @@ struct spa_meta_bitmap {
* Cursor information
*/
struct spa_meta_cursor {
uint32_t id; /**< cursor id */
uint32_t id; /**< cursor id, SPA_ID_INVALID for no cursor */
int32_t x, y; /**< offsets on screen */
int32_t hotspot_x, hotspot_y; /**< offsets for hotspot in bitmap */
uint32_t bitmap_offset; /**< offset of bitmap meta in this structure */

View file

@ -133,7 +133,8 @@ on_stream_process(void *_data)
data->rect.h = mc->height;
}
}
if ((mcs = spa_buffer_find_meta(b, data->type.meta_cursor))) {
if ((mcs = spa_buffer_find_meta(b, data->type.meta_cursor)) &&
mcs->id != SPA_ID_INVALID) {
struct spa_meta_bitmap *mb;
void *cdata;
int cstride;