[FFmpeg-devel] [PATCH] ALSA for libavdevice

Michael Niedermayer michaelni
Wed Dec 17 20:02:47 CET 2008


On Wed, Dec 17, 2008 at 06:33:10PM +0100, Nicolas George wrote:
> Le septidi 27 frimaire, an CCXVII, Michael Niedermayer a ?crit?:
> > > +        av_log(NULL, AV_LOG_ERROR, "-ESTRPIPE... Unsupported!\n");
> > this should be s1
> 
> I thought I had them all. Fixed.
> 
> > > +            pkt->size = 0;
> > unneeded?
> 
> Indeed. Removed.
> 
> > > +    pkt->pts = (int64_t)timestamp.tv_sec * 1000000 +
> > > +        (timestamp.tv_nsec + 500) / 1000;
> > > +    pkt->pts -= (int64_t)(ts_delay * 1000000 + st->codec->sample_rate / 2) /
> > > +        st->codec->sample_rate;
> > if the cast is supposed to prevent an overflow of ts_delay * 1000000 then its
> > at the wrong spot. Otherwise i dont see why the cast is there at all
> 
> The cast was supposed to be inside the parentheses.
> 
> > besides this the rounding is still not correct, following is correct
> > pkt->pts = timestamp.tv_sec * 1000000LL
> >           + ( timestamp.tv_nsec * st->codec->sample_rate
> >              -ts_delay * 1000000000LL + st->codec->sample_rate*500LL) / (st->codec->sample_rate * 1000LL)
> 
> That is true; each was correct alone, but not together. I took your formula
> after checking there was no risk of integer overflow. I am always at loss to
> indent such long formulas, though.

ok, if someone has tested both recording & playback (ideally with video) and
it worked (including AV sync)

also assuming noone with ALSA knowledge has objections or further comments

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081217/fb933d75/attachment.pgp>



More information about the ffmpeg-devel mailing list