From: Andre Noll Date: Thu, 13 Oct 2011 14:10:11 +0000 (+0200) Subject: para_filter: Decode also small ogg vorbis files properly. X-Git-Tag: v0.4.9~19 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=fb5d56ca5ec72163e2ef0665a857a9020679be0a;p=paraslash.git 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. --- 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; }