On 11/26/2011 07:57 PM, Ronald S. Bultje wrote: > Hi, > > On Sat, Nov 26, 2011 at 2:07 PM, Justin Ruggles > <[email protected]> wrote: >> + /* get output buffer */ >> + s->frame.nb_samples = 480; >> + if ((res = ctx->get_buffer(ctx, &s->frame)) < 0) { >> + av_log(ctx, AV_LOG_ERROR, "get_buffer() failed\n"); >> + return res; >> } >> + s->frame.nb_samples = n_samples; >> + samples = (float *)s->frame.data[0]; > > So I know later on, if the frame is smaller than 480 samples, you set > it to be smaller. However, does this affect DR1 and is it documented? > I.e. if I request 480 samples but only fill 240, is that OK? Is the > app supposed to handle that? Or should I delay the allocation until I > know how many samples I'll actually use?
I suppose it should be documented. The app should handle the nb_samples in the returned frame. There are a small number of cases where requesting a larger buffer is needed. I tried to avoid it when it was possible without too much complication. -Justin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
