diff options
author | phintuka <phintuka> | 2009-10-19 11:42:14 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2009-10-19 11:42:14 +0000 |
commit | 205c30f4eaf7185ee6e353f8596a70be7c5ec242 (patch) | |
tree | c3a5086c9ff5314efa8fe7e86f61d4a39ef3a357 | |
parent | 610d20dbf0d738afddc2d65a0f978a18f6709edc (diff) | |
download | xineliboutput-205c30f4eaf7185ee6e353f8596a70be7c5ec242.tar.gz xineliboutput-205c30f4eaf7185ee6e353f8596a70be7c5ec242.tar.bz2 |
Do not update overlay if all elements are unchanged
-rw-r--r-- | xine/BluRay/decode_spuhdmv.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/xine/BluRay/decode_spuhdmv.c b/xine/BluRay/decode_spuhdmv.c index bae201e8..86cae67e 100644 --- a/xine/BluRay/decode_spuhdmv.c +++ b/xine/BluRay/decode_spuhdmv.c @@ -67,6 +67,8 @@ struct subtitle_clut_s { uint32_t color[256]; uint8_t trans[256]; subtitle_clut_t *next; + + int shown; }; /* @@ -87,6 +89,8 @@ struct subtitle_object_s { size_t raw_data_size; subtitle_object_t *next; + + int shown; }; /* @@ -99,6 +103,8 @@ struct window_def_s { uint16_t width, height; window_def_t *next; + + int shown; }; @@ -118,6 +124,8 @@ struct composition_object_s { uint16_t crop_width, crop_height; composition_object_t *next; + + int shown; }; typedef struct composition_descriptor_s composition_descriptor_t; @@ -139,6 +147,7 @@ struct presentation_segment_s { //presentation_segment_t *next; int64_t pts; + int shown; }; /* @@ -627,7 +636,7 @@ static int decode_window_definition(spuhdmv_decoder_t *this) } static int show_overlay(spuhdmv_decoder_t *this, composition_object_t *cobj, uint palette_id_ref, - int overlay_index, int64_t pts) + int overlay_index, int64_t pts, int force_update) { video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager(this->stream->video_out); metronom_t *metronom = this->stream->metronom; @@ -661,6 +670,11 @@ static int show_overlay(spuhdmv_decoder_t *this, composition_object_t *cobj, uin return -1; } + /* do not show again if all elements are unchanged */ + if (!force_update && clut->shown && obj->shown && wnd->shown && cobj->shown) + return 0; + clut->shown = obj->shown = wnd->shown = cobj->shown = 1; + /* copy palette to xine overlay */ overlay.rgb_clut = 0; memcpy(overlay.color, clut->color, sizeof(uint32_t) * 256); @@ -725,10 +739,12 @@ static void show_overlays(spuhdmv_decoder_t *this, presentation_segment_t *pseg) if (!cobj) { ERROR("show_overlays: composition object %d missing !\n", i); } else { - show_overlay(this, cobj, pseg->palette_id_ref, i, pseg->pts); + show_overlay(this, cobj, pseg->palette_id_ref, i, pseg->pts, !pseg->shown); cobj = cobj->next; } } + + pseg->shown = 1; } static void hide_overlays(spuhdmv_decoder_t *this, int64_t pts) |