Age | Commit message (Collapse) | Author |
|
(eg for streams that send PES payloads not aligned to frame boundaries).
|
|
Dont get fooled by subtitle buffers with pts seconds away from video for example.
|
|
The problem
When watching live DVB, data is delivered strictly at the broadcasters
speed. We cannot change it through server commands. Our local systems clock
usually runs slightly faster or slower than that, causing a/v fifos to run
empty or full after a few minutes.
Standard network buffering control only handles the first case by pausing
the engine (not nice). The latter case ends up in severe stuttering and an
a/v lag of several seconds (annoying).
I tried quite a few differnt algorithms, and this one made it:
a 3 point controller.
There is a target buffer fill window with a center and some tolerated width:
Minimum:
definition: 1 second
safety: clamped to 38% of fio size
action: switch playback speed to 99.5%
Center:
definition: 2 seconds
safety: clamped to 73% fifo size
action: switch to normal playback speed
Maximum:
definition: 3 seconds
safety: clamped to 98% fifo fill
action: switch playback speed to 100.5%
If the usual dvb audio to video muxing delay is more than 1 second, center
time is increased. On low bitrate radio, window width is increased.
Real TVs do adjust playback audio sampling rate to follow delivery speed.
Some PC sound cards can do that, too. It could be implemented transparently
(although I don't know yet how). This comes quite close, resampling audio to
stretch.
That half percent is large enough to cover clock deviation, and it is small
enough not to cause audible pitch bending. Speed control consists of
adjusting SCR and telling audio out. Doing just the first will cause
metronom to drop and/or insert whole audio frames, not nice with music.
BTW. this one needs demux_ts to send BUF_FLAG_FRAME_START.
|
|
This event reports the buffer status for network streams (NBC) back to the
application, providing a way to measure if the stream delivers data fast
enough. This enables the application to slow down the stream playback to
get the buffers filling more quickly. (This is only a sample application of
the event.)
The event reports all vital data like fill percentage, remaining buffer in
seconds and discontinuity, separately for audio and video, whether the nbc
layer is actually buffering, the operation type (put or get) and also if the
buffering is enabled at all.
In essence, it's the output you get from nbc if you run xine-lib in
verbose mode on the console, but in raw data.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The xine_xmalloc() function is going to be deprecated, as its
behaviour is rarely needed as such, and it's thus misused.
With this, almost all uses of xine_xmalloc() with static size (for
instance the value returned by sizeof()) or with a size that is
guaranteed not to be zero (like strlen()+1) are replaced with calls to
either calloc(1, ...) or malloc().
malloc() is used whenever the allocated memory is going to be
immediately overwritten, while calloc() is used in every other case,
as it sets the whole memory area to zero.
--HG--
extra : transplant_source : %8F%98%EC%02%1E%83%F0s%06X%83C%205Y%80%B12%CC%E1
|
|
|
|
|
|
For contributed code, leave whatever the version we last synced for is using
to make simpler future syncs.
|
|
CVS patchset: 8707
CVS date: 2007/03/17 19:15:58
|
|
Improved cross-compiling: detect and precedence of the host-specific libs
W32dll: enabled by platforms as originaly, user can override it
Fixed shell errors in the Makefile of the hackersguide
Detect the place of SDL header independently on platform
Fixed spelling in CDDA, include the header sys/param.h if available
Fixed format strings (fix warnings (or even bugs) on Gentoo/FreeBSD)
CVS patchset: 7815
CVS date: 2005/11/28 12:24:56
|
|
and backwards compatible translation
Sorry, I got a litte tired proof-reading the patch, so their might be
bugs lurking around. I will give it some further examination and
(as necessary) fixing tomorrow.
CVS patchset: 7233
CVS date: 2004/12/12 22:00:47
|
|
Fix video as well
CVS patchset: 6997
CVS date: 2004/09/23 16:41:39
|
|
That's either that, or always registering audio.num_buffers in
src/xine-engine/audio_decoder.c
CVS patchset: 6994
CVS date: 2004/09/23 15:19:47
|
|
* apply a correction factor to the high water mark, if the user has configured
a different size for the stream FIFOs
CVS patchset: 6886
CVS date: 2004/08/16 15:23:21
|
|
CVS patchset: 6317
CVS date: 2004/03/29 19:11:30
|
|
CVS patchset: 6315
CVS date: 2004/03/28 20:58:06
|
|
try to evaluate the amount of data inside decoders, audio decoders tends to keep a lot, and that's why the audio fifo keeps empty. This remove the "50%" step with video trailers, and the playback starts earlier.
- fix a potential deadlock at exit.
- increase high watermark if rebuffering
I've tested with asf/mpeg/mov/real streams.
CVS patchset: 6310
CVS date: 2004/03/28 18:17:34
|
|
CVS patchset: 6308
CVS date: 2004/03/26 12:30:04
|
|
Note: _x_set_speed deadlocks !
CVS patchset: 6248
CVS date: 2004/03/13 22:25:05
|
|
* use _x_set_speed() for speed manipulations, since it is ticket-safe
* _x_set_speed() is an internal helper function now, move frontend locking
outside of it
* restrict access to metronom clock internal stuff
CVS patchset: 6165
CVS date: 2004/02/16 20:19:09
|
|
CVS patchset: 6136
CVS date: 2004/02/12 18:09:19
|
|
relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
CVS patchset: 5844
CVS date: 2003/12/05 15:54:56
|
|
scratch buffer enhancement (thanks Thibaut for the malloc tips), enlarge log buffer from 25 lines (very useless), to 150 (better).
CVS patchset: 5801
CVS date: 2003/11/26 23:44:08
|
|
CVS patchset: 5796
CVS date: 2003/11/26 19:43:26
|
|
BIG NOTE: use helpers to access to these informations (get/set/reset):
_x_{stream,meta}_info_{get,set,reset}()
are for internal use, don't use *_public() ones from inside the beast ;-)
Some wrongly names "xine_" fonction renaming.
CVS patchset: 5757
CVS date: 2003/11/16 23:33:42
|
|
CVS patchset: 5731
CVS date: 2003/11/15 13:01:00
|
|
Fix a problem introduced by the previous cleanup.
CVS patchset: 5533
CVS date: 2003/10/17 00:35:45
|
|
CVS patchset: 5532
CVS date: 2003/10/16 22:15:09
|
|
CVS patchset: 5528
CVS date: 2003/10/15 23:47:12
|
|
- fix discontinuity handling.
- use lprinf
- cleanup
CVS patchset: 5522
CVS date: 2003/10/14 22:54:45
|
|
Patch from Ramon van der Aar <rvda@itsec-ps.nl>
CVS patchset: 5434
CVS date: 2003/10/04 14:36:05
|
|
fft*post are untouched (fft: for now).
CVS patchset: 5310
CVS date: 2003/08/25 21:51:37
|
|
CVS patchset: 4840
CVS date: 2003/05/13 16:38:04
|
|
See xine-devel for details.
Basicaly it adds callbacks to fifo, and everything is done at fifo level now.
It fixes deadlocks with ogg/ogm streams, pauses the engine at the right time, and evaluates better the length of the data in fifos (using pts when the bitrate is not constant).
Enjoy.
CVS patchset: 4513
CVS date: 2003/03/30 15:19:45
|
|
It caused problems with radios.
CVS patchset: 4280
CVS date: 2003/02/24 01:24:19
|
|
streams)
- 'mplayer like' debug mode ('\r') ;)
CVS patchset: 4278
CVS date: 2003/02/24 00:04:36
|
|
engine if buffering.
CVS patchset: 4269
CVS date: 2003/02/23 21:52:42
|
|
CVS patchset: 4267
CVS date: 2003/02/23 19:42:23
|
|
- Uses the num_free() method
There is still a problem when buffering at the end of the stream.
CVS patchset: 4266
CVS date: 2003/02/23 19:33:47
|
|
CVS patchset: 4264
CVS date: 2003/02/23 15:56:42
|
|
- Report a progress even if the bitrate is not known
CVS patchset: 4197
CVS date: 2003/02/18 23:15:07
|
|
see http://sourceforge.net/mailarchive/forum.php?thread_id=1568239&forum_id=7131
CVS patchset: 4116
CVS date: 2003/02/08 13:52:44
|
|
CVS patchset: 4035
CVS date: 2003/01/29 11:08:11
|
|
CVS patchset: 4017
CVS date: 2003/01/26 23:36:46
|