]> git.tuebingen.mpg.de Git - paraslash.git/commit
para_filter: Decode also small ogg vorbis files properly.
authorAndre Noll <maan@systemlinux.org>
Thu, 13 Oct 2011 14:10:11 +0000 (16:10 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 13 Oct 2011 15:11:40 +0000 (17:11 +0200)
commitfb5d56ca5ec72163e2ef0665a857a9020679be0a
treeff40e1a1b7ca16a6100e0c19b01a6f03df83cad8
parentc5670af5c1f784fe6c3d46d0281f2ba7c47af75e
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