[Libav-user] Why (c->frame_size = 0) ?

Joe Flowers joe.flowers at nofreewill.com
Mon Feb 25 19:23:28 CET 2013


In the decoding_encoding.c file, I have changed


codec = avcodec_find_encoder(AV_CODEC_ID_MP2);
to
codec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE);


but now I get


"Could not allocate -22 bytes for samples buffer"

back from

buffer_size = av_samples_get_buffer_size(NULL, c->channels,
c->frame_size, c->sample_fmt, 0);


Anyone know how I can fix this problem?

Thanks!

Joe

----------------------------------------------------
//For AV_CODEC_ID_PCM_S16LE:
//c->channels = (2).
//c->frame_size = (0).
//c->sample_fmt = (1).

//For AV_CODEC_ID_MP2:
//c->channels = (2).
//c->frame_size = (1152).
//c->sample_fmt = (1).
-----------------------------------------------------


More information about the Libav-user mailing list