[libbluray-devel] Splitted _check_epoch_start() from _decode_ics()

hpi1 git at videolan.org
Fri May 6 14:38:43 CEST 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri May  6 14:42:33 2011 +0300| [0bee3610eaee7310413b407e8558fd692b455269] | committer: hpi1

Splitted _check_epoch_start() from _decode_ics()

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=0bee3610eaee7310413b407e8558fd692b455269
---

 src/libbluray/decoders/graphics_processor.c |   37 ++++++++++++++++-----------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/src/libbluray/decoders/graphics_processor.c b/src/libbluray/decoders/graphics_processor.c
index f3b9412..12eeffe 100644
--- a/src/libbluray/decoders/graphics_processor.c
+++ b/src/libbluray/decoders/graphics_processor.c
@@ -264,6 +264,27 @@ static int _decode_pds(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p)
     return 0;
 }
 
+static void _check_epoch_start(PG_DISPLAY_SET *s)
+{
+    if (s->ics->composition_descriptor.state == 2) {
+        /* epoch start, drop all cached data */
+
+        unsigned ii;
+        for (ii = 0; ii < s->num_object; ii++) {
+            pg_clean_object(&s->object[ii]);
+        }
+
+        s->num_palette = 0;
+        s->num_window  = 0;
+        s->num_object  = 0;
+
+        s->epoch_start = 1;
+
+    } else {
+        s->epoch_start = 0;
+    }
+}
+
 static int _decode_pcs(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p)
 {
     (void)s;
@@ -287,22 +308,8 @@ static int _decode_ics(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p)
     s->ics->pts = p->pts;
 
     s->valid_pts   = s->ics->pts;
-    s->epoch_start = 0;
-
-    if (s->ics->composition_descriptor.state == 2) {
-        /* epoch start, drop all cached data */
-
-        unsigned ii;
-        for (ii = 0; ii < s->num_object; ii++) {
-            pg_clean_object(&s->object[ii]);
-        }
 
-        s->num_palette = 0;
-        s->num_window = 0;
-        s->num_object = 0;
-
-        s->epoch_start = 1;
-    }
+    _check_epoch_start(s);
 
     return 1;
 }



More information about the libbluray-devel mailing list