1 From 3e66b97221440b17a184feb48692dce7e0561cac Mon Sep 17 00:00:00 2001
2 From: Matt Ranostay <matt.ranostay@konsulko.com>
3 Date: Wed, 8 Mar 2017 16:30:01 -0800
4 Subject: [PATCH] plugin: ogg: fix chucksize issue
6 There are some OGG files that have metadata chucks that go over the
7 hardcoded 10 * 4096 size due to album art. This patchset just parses
8 each chuck and continues till it runs out of valid chunks.
10 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
12 src/plugins/ogg/ogg.c | 11 ++---------
13 1 file changed, 2 insertions(+), 9 deletions(-)
15 diff --git a/src/plugins/ogg/ogg.c b/src/plugins/ogg/ogg.c
16 index 1c0818e..c94dc38 100644
17 --- a/src/plugins/ogg/ogg.c
18 +++ b/src/plugins/ogg/ogg.c
23 -#define MAX_CHUNKS_PER_PAGE 10
26 struct lms_stream base;
28 @@ -122,10 +120,8 @@ _set_lms_info(struct lms_string_size *info, const char *tag)
30 static bool _ogg_read_page(FILE *fp, ogg_sync_state *osync, ogg_page *page)
34 - for (i = 0; i < MAX_CHUNKS_PER_PAGE && ogg_sync_pageout(osync, page) != 1;
36 + while(ogg_sync_pageout(osync, page) != 1)
38 lms_ogg_buffer_t buffer = lms_get_ogg_sync_buffer(osync, CHUNKSIZE);
39 int bytes = fread(buffer, 1, CHUNKSIZE, fp);
41 @@ -136,9 +132,6 @@ static bool _ogg_read_page(FILE *fp, ogg_sync_state *osync, ogg_page *page)
42 ogg_sync_wrote(osync, bytes);
45 - if (i > MAX_CHUNKS_PER_PAGE)