[MPlayer-dev-eng] [PATCH] mencoder: detect end of audio stream while encoded data still buffered
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sat May 3 18:27:40 CEST 2014
On Sun, Apr 27, 2014 at 04:42:37PM +0930, Kieran Clancy wrote:
> In any case, the fix turned out to be very simple; there is no need to
> assume that mux_a->buffer_len is zero on end-of-stream. Even if there
> is outstanding data in mux_a->buffer, end-of-stream means it will
> never be muxed into the output because dec_audio() will not provide
> any more data for aencoder->encode().
Why do you think that?
It could be the data is only there because the encoder just couldn't
encode all of it at once, so just going through the loop once more
(if things are done correctly) might consume some/all of it still.
Except that I actually don't get the relation to mp3lame at all,
the issue to me looks like the muxer won't accept all data,
so I _think_ the right solution would be to remove the condition indeed,
but then call muxer_write_chunk once more with a "flush" flag or so to
force the remaining data out.
More information about the MPlayer-dev-eng
mailing list