Fix pull_api mode
authormiv <miv@ableton.com>
Fri, 14 Jul 2017 10:25:22 +0000 (12:25 +0200)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 25 Jul 2017 16:53:25 +0000 (12:53 -0400)
commitac6b2112da610f474389a53628d86c545821fe69
tree22319fbbf25c0eed9c6d37e77aa409fa655c8003
parent17f9d3dab46e02b3389f69d3e015544fe18a90da
Fix pull_api mode

ope_encoder_create_pull calls ope_encoder_create_callbacks with a
NULL callbacks argument, which causes the function to crash. Test
for NULL to prevent this.

As well, we try and call the close callback when flushing the stream,
which also leads to a crash when the callbacks are not set. Don't call
the callback in pull mode.

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
src/opusenc.c