[FFmpeg-devel] A question about flushing the MP3 decoder.

Dale Curtis dalecurtis at chromium.org
Thu Jun 5 22:58:48 CEST 2014


On Thu, Jun 5, 2014 at 12:37 PM, Michael Niedermayer <michaelni at gmx.at>
wrote:

> On Wed, Jun 04, 2014 at 06:03:51PM -0700, Dale Curtis wrote:
> > I'm noticing that decoding packets, flushing, and then decoding the same
> > packets again doesn't give exactly the same buffers back (as indicated by
> > an MD5 sum). I was able to "fix" this by adding the following to
> mp_flush():
> >
> >     memset(ctx->mdct_buf, 0, sizeof(ctx->mdct_buf));
> >     ctx->dither_state = 0;
>
> >
> > Is this correct / necessary?
>
> i would assume that it still doesnt match if one compares packet X
> while flushing and decoding started from different points prior
> each time. (due to dither state being different)
>
>
AVSEEK_FLAG_BACKWARD helps in this case, since it's likely you'll pick up
the buffer before the desired seek point and need to discard after decoding.



> But reseting these should do no harm, so applied
>

Thanks!


More information about the ffmpeg-devel mailing list