swr: Fix partial flushing.

Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-03-25 05:58:31 +02:00
parent 19342bc725
commit 8b11ae8a9a
1 changed files with 2 additions and 2 deletions

View File

@ -160,6 +160,8 @@ int swr_init(struct SwrContext *s){
swri_audio_convert_free(&s->out_convert); swri_audio_convert_free(&s->out_convert);
swri_audio_convert_free(&s->full_convert); swri_audio_convert_free(&s->full_convert);
s->flushed = 0;
s-> in.planar= av_sample_fmt_is_planar(s-> in_sample_fmt); s-> in.planar= av_sample_fmt_is_planar(s-> in_sample_fmt);
s->out.planar= av_sample_fmt_is_planar(s->out_sample_fmt); s->out.planar= av_sample_fmt_is_planar(s->out_sample_fmt);
s-> in_sample_fmt= av_get_alt_sample_fmt(s-> in_sample_fmt, 0); s-> in_sample_fmt= av_get_alt_sample_fmt(s-> in_sample_fmt, 0);
@ -529,8 +531,6 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun
//FIXME packed doesnt need more than 1 chan here! //FIXME packed doesnt need more than 1 chan here!
swri_audio_convert(s->out_convert, out, preout, out_count); swri_audio_convert(s->out_convert, out, preout, out_count);
} }
if(!in_arg)
s->in_buffer_count = 0;
return out_count; return out_count;
} }