[libbluray-devel] Simplify
hpi1
git at videolan.org
Sat May 14 14:23:52 CEST 2011
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat May 14 15:23:15 2011 +0300| [65e0d807d3e487107ca032a5a50976b5d3f3052c] | committer: hpi1
Simplify
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=65e0d807d3e487107ca032a5a50976b5d3f3052c
---
src/libbluray/decoders/graphics_processor.c | 18 ++----------------
1 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/src/libbluray/decoders/graphics_processor.c b/src/libbluray/decoders/graphics_processor.c
index 358555f..0e4d151 100644
--- a/src/libbluray/decoders/graphics_processor.c
+++ b/src/libbluray/decoders/graphics_processor.c
@@ -73,28 +73,14 @@ void pg_display_set_free(PG_DISPLAY_SET **s)
* segment handling
*/
-static PES_BUFFER *_find_segment_by_type(PES_BUFFER *p, uint8_t seg_type)
-{
- while (p) {
- if (p->buf[0] == seg_type) {
- return p;
- }
- p = p->next;
- }
- return NULL;
-}
-
static PES_BUFFER *_find_segment_by_idv(PES_BUFFER *p,
uint8_t seg_type, unsigned idv_pos,
uint8_t *idv, unsigned idv_len)
{
- while (NULL != (_find_segment_by_type(p, seg_type))) {
- if (!memcmp(p->buf + idv_pos, idv, idv_len)) {
- return p;
- }
+ while (p && (p->buf[0] != seg_type || memcmp(p->buf + idv_pos, idv, idv_len))) {
p = p->next;
}
- return NULL;
+ return p;
}
static void _join_fragments(PES_BUFFER *p1, PES_BUFFER *p2, int data_pos)
More information about the libbluray-devel
mailing list