From fb5d56ca5ec72163e2ef0665a857a9020679be0a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 13 Oct 2011 16:10:11 +0200 Subject: [PATCH] para_filter: Decode also small ogg vorbis files properly. ogg_post_select() returns after initializing the decoder without decoding anything, which is usually OK. However, if the file is smaller than half of the size of the stdin buffer tree area, the whole file is going to be fed to the decoder during the first iteration of the scheduler loop. Currently this results in an empty output file. The problem with small files is that the post select function of the stdin buffer tree node encounters EOF on the next read and returns EOF. This causes oggdec_post_select() to abort without producing any output since its parent (stdin) is gone and there is no input pending. This patch fixes the problem by setting the "have_more" flag after ogg_init() returned successfully. oggdec_post_select() checks this flag and only returns negative if it is unset. --- oggdec_filter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/oggdec_filter.c b/oggdec_filter.c index 32ffdef9..07e4cec1 100644 --- a/oggdec_filter.c +++ b/oggdec_filter.c @@ -175,6 +175,7 @@ out: pod->converted = 0; fn->min_iqs = 0; pod->vf = vf; + pod->have_more = true; } return ret; } -- 2.39.5