[MPlayer-dev-eng] [PATCH] mencoder: Support flushing audio encoders at end of stream.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed May 7 20:38:09 CEST 2014


On 07.05.2014, at 15:59, Kieran Clancy <clancy.kieran+mplayer at gmail.com> wrote:
> On Wed, May 7, 2014 at 4:01 AM, Reimar Döffinger
> <Reimar.Doeffinger at gmx.de> wrote:
>> +                               // try flushing encoder
>> +                               if (len <= 0 && sh_audio->ds->eof)
>> +                                       len = aencoder->encode(aencoder, mux_a->buffer + mux_a->buffer_len, NULL, 0, mux_a->buffer_size-mux_a->buffer_len);
> 
> Have you checked that lavc and all other codecs properly handle a NULL
> src pointer?

Which "others"? We don't have that many, I think toolame is the only one remaining. Note that len will be 0, so if it dereferences the pointer I'd call that a bug.

> Wouldn't it be better to add another function to the aencoder struct
> so that we can do aencoder->flush(mux_a->buffer+...) rather than
> overload a function with multiple meanings?

No, because:

> Also, I don't see anything which is going to trigger the lavc's own
> frame padding here - does it do it automatically?

It is triggered by a NULL pointer, so this just makes MPlayer follow FFmpeg API.
(though it will need some minor special handling if/when we switch to encode_audio2 API)


More information about the MPlayer-dev-eng mailing list