On Fri, Jan 23, 2015 at 2:20 PM, Anton Shekhovtsov <[email protected]>
wrote:

> I used swresample only to convert format but it looks simple as brick to
> me.
>
>
Is there somewhere a hidden question "What is the problem in the first
place?" :)

Probably I missed the point somewhere, but some codecs report particular
frame_size so one should feed data only with blocks having this particular
size. A quote from the sources about
AVCodecContext.frame_size
...
     * - encoding: ... Each submitted frame
     *   except the last must contain exactly frame_size samples per
channel.
     *   May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set,
then the
     *   frame size is not restricted.
     *)


If incoming data has the same sample_rate as outgoing, no problem,
swr_convert will output the same amount of frames as it accepted. But if
the sample rate are different (44.1k vs 48 k), you can't avoid tricky
arithmetic/logic or caching extra data somewhere unless you have plans to
violate the rule.
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to