[FFmpeg-devel] [PATCH v2] avformat/pcm: decrease delay when reading PCM streams.

Philipp M. Scholl pscholl at bawue.de
Thu Feb 15 11:17:59 EET 2018


On Wed, Feb 14, 2018 at 03:41:18PM +0100, Tomas Härdin wrote:
[..snip..]
> FFMAX(codec->sample_rate/25, 1) would be nicer
>
agree.

> > +    size = FFMIN(size, RAW_SAMPLES * codec->block_align);
> > +    size = 1 << ff_log2(size);
> > -    size= RAW_SAMPLES*s->streams[0]->codecpar->block_align;
> >       if (size <= 0)
> >           return AVERROR(EINVAL);
> 
> This will never be true since ff_log() always returns >= 0 which makes size
> >= 1. I suggest putting it before the 1 << ff_log2.
> 
 This can only happen when block_align == 0. So, a check à la

  if (codec->block_align <= 0)
    return AVERROR(EINVAL);

 before calculating the size, should suffice?

> > -    ret= av_get_packet(s->pb, pkt, size);
> > +    ret = av_get_packet(s->pb, pkt, size);
> 
> Doesn't looks like it belongs, but it makes all the assignments align so
> whatever
> 
> /Tomas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180215/94a4e8d0/attachment.sig>


More information about the ffmpeg-devel mailing list