diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/mpegplayer/stream_mgr.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c index 24e820b0af..c9601b8593 100644 --- a/apps/plugins/mpegplayer/stream_mgr.c +++ b/apps/plugins/mpegplayer/stream_mgr.c | |||
@@ -993,33 +993,19 @@ int stream_init(void) | |||
993 | 993 | ||
994 | /* Initialize non-allocator blocks first */ | 994 | /* Initialize non-allocator blocks first */ |
995 | #ifndef HAVE_LCD_COLOR | 995 | #ifndef HAVE_LCD_COLOR |
996 | bool success; | 996 | long greysize; |
997 | long graysize; | ||
998 | void *graymem; | ||
999 | |||
1000 | #ifdef PROC_NEEDS_CACHEALIGN | ||
1001 | /* This can run on another processor - align data */ | ||
1002 | memsize = CACHEALIGN_BUFFER(&mem, memsize); | ||
1003 | graymem = UNCACHED_ADDR(mem); | ||
1004 | #else | ||
1005 | graymem = mem; | ||
1006 | #endif | ||
1007 | |||
1008 | success = grey_init(rb, graymem, memsize, GREY_BUFFERED|GREY_ON_COP, | ||
1009 | LCD_WIDTH, LCD_HEIGHT, &graysize); | ||
1010 | |||
1011 | /* This can run on another processor - align size */ | ||
1012 | graysize = CACHEALIGN_UP(graysize); | ||
1013 | 997 | ||
1014 | mem += graysize; | 998 | /* Greylib init handles all necessary cache alignment */ |
1015 | memsize -= graysize; | 999 | if (!grey_init(rb, mem, memsize, GREY_BUFFERED|GREY_ON_COP, |
1016 | 1000 | LCD_WIDTH, LCD_HEIGHT, &greysize)) | |
1017 | if (!success || (ssize_t)memsize <= 0) | ||
1018 | { | 1001 | { |
1019 | rb->splash(HZ, "greylib init failed!"); | 1002 | rb->splash(HZ, "greylib init failed!"); |
1020 | return STREAM_ERROR; | 1003 | return STREAM_ERROR; |
1021 | } | 1004 | } |
1022 | 1005 | ||
1006 | mem += greysize; | ||
1007 | memsize -= greysize; | ||
1008 | |||
1023 | grey_clear_display(); | 1009 | grey_clear_display(); |
1024 | #endif /* !HAVE_LCD_COLOR */ | 1010 | #endif /* !HAVE_LCD_COLOR */ |
1025 | 1011 | ||