[FFmpeg-devel] [PATCH 2/2] lavd/pulse_audio_enc: allow non monotonic streams

Michael Niedermayer michaelni at gmx.at
Wed Jan 8 14:39:26 CET 2014


On Wed, Jan 08, 2014 at 02:34:53PM +0100, Michael Niedermayer wrote:
> On Wed, Jan 08, 2014 at 01:51:36PM +0100, Lukasz M wrote:
> > >
> > >
> > > > OTOH, I am afraid this patchset is wrong for another reason: if a
> > > timestamp
> > > > discontinuity is feed to the device, then av_get_output_timestamp() will
> > > > return strange results while the samples around the discontinuity are in
> > > the
> > > > device buffer. I believe the application should not pass through the
> > > > timestamps from the input and rather synthesize its own monotonic
> > > > timestamps.
> > >
> > 
> > I did expect that flush is done before writing packet with discontinued
> > timestamp.
> > In case of pulseaudio pa_simple_drain (which waist until whole buffer is
> > played) can be used when discontinuity is detected.
> > 
> 
> > Regarding synthesizing monotonic timestamps ffmpeg does it itself, so
> > application may just do nothing, but it is not easy by application to
> > determine current position in audio stream. Imagine you have 1sec buffer
> > and you do seek every 0,1sec. Determining current position in stream is
> > quite hard.
> 
> iam not sure its easier if you pass timestamps through unchanged
> 
> consider mpeg-ps, mpeg-ts or ogg these all allow timestamp
> discontinuities so knowing timestamp 0 is displayed doesnt neccesarily
> tell you which that is.
> You could of course "remove" these discontinuities but then you
> do almost the same as if you remove the discontinuities from seeks too
> 
> also with a seek every 0.1 sec, you would flush the not yet presented
> frames before injecting new frames in the buffer so the buffer would
> not hold much
> 
> 
> a function like
> 
> av_get_currently_presented_frame(AVOutputFormat *s, AVFrame *out, int *time_delta_out)
> 
> that would give the user not just a timestamp but the whole currently
> presented AVFrame (or AVPacket) could give you actual timestamp in
> ether API, byte position in file, and all the metadata/side data
> thats in it (might be usefull to display something like the currently
> played artist / song title)
> 

> also a function like av_get_currently_presented_frame() could be
> implemented in generic code requiring no changed in output devices
> just information about the current latency of the device

or the latency returning function could be implemented from the
avframe + time_delta returning one


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140108/b780fced/attachment.asc>


More information about the ffmpeg-devel mailing list