diff options
author | Petri Hintukainen <phintuka@users.sourceforge.net> | 2009-11-03 22:32:05 +0200 |
---|---|---|
committer | Petri Hintukainen <phintuka@users.sourceforge.net> | 2009-11-03 22:32:05 +0200 |
commit | 9b0a520a6e0d09daefd4916a4298f099907f44f3 (patch) | |
tree | 47a17eae3cc9f2d6e10fada04ce487e017c8d7a8 | |
parent | 145602985c83694699c4984a21ad61165e2c8859 (diff) | |
download | xine-lib-9b0a520a6e0d09daefd4916a4298f099907f44f3.tar.gz xine-lib-9b0a520a6e0d09daefd4916a4298f099907f44f3.tar.bz2 |
show_overlays() → update_overlays()
-rw-r--r-- | src/libspuhdmv/xine_hdmv_decoder.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/src/libspuhdmv/xine_hdmv_decoder.c b/src/libspuhdmv/xine_hdmv_decoder.c index 04586d750..8ffd4e3aa 100644 --- a/src/libspuhdmv/xine_hdmv_decoder.c +++ b/src/libspuhdmv/xine_hdmv_decoder.c @@ -726,23 +726,6 @@ static int show_overlay(spuhdmv_decoder_t *this, composition_object_t *cobj, uin return 0; } -static void show_overlays(spuhdmv_decoder_t *this, presentation_segment_t *pseg) -{ - composition_object_t *cobj = pseg->comp_objs; - int i; - - for (i = 0; i < pseg->object_number; i++) { - if (!cobj) { - ERROR("show_overlays: composition object %d missing !\n", i); - } else { - 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) { video_overlay_event_t event = {0}; @@ -768,6 +751,33 @@ static void hide_overlays(spuhdmv_decoder_t *this, int64_t pts) } } +static void update_overlays(spuhdmv_decoder_t *this, presentation_segment_t *pseg) +{ + if (!pseg->comp_descr.state) { + + /* HIDE */ + if (!pseg->shown) + hide_overlays (this, pseg->pts); + + } else { + + /* SHOW */ + composition_object_t *cobj = pseg->comp_objs; + int i; + + for (i = 0; i < pseg->object_number; i++) { + if (!cobj) { + ERROR("show_overlays: composition object %d missing !\n", i); + } else { + show_overlay(this, cobj, pseg->palette_id_ref, i, pseg->pts, !pseg->shown); + cobj = cobj->next; + } + } + } + + pseg->shown = 1; +} + static int decode_presentation_segment(spuhdmv_decoder_t *this) { presentation_segment_t p = {}; @@ -792,12 +802,7 @@ static int decode_presentation_segment(spuhdmv_decoder_t *this) p.comp_objs = cobj; } - if (!p.comp_descr.state) { - hide_overlays (this, this->pts); - } else { - show_overlays (this, &p); - LIST_DESTROY (p.comp_objs, free); - } + update_overlays (this, &p); return buf->error; } |