summaryrefslogtreecommitdiff
path: root/src/input/net_buf_ctrl.c
AgeCommit message (Collapse)Author
2011-10-18net_buf_ctrl: dvb sync: dont rely on demuxer sending BUF_FLAG_FRAME_STARTTorsten Jager
(eg for streams that send PES payloads not aligned to frame boundaries).
2011-10-18net_buf_ctrl: dvb sync: observe a/v buffers only.Torsten Jager
Dont get fooled by subtitle buffers with pts seconds away from video for example.
2011-08-26DVB syncTorsten Jager
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.
2010-04-11Report NBC buffer stats to the application using new event XINE_EVENT_NBC_STATSFrank Enderle
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.
2010-02-25isatty() takes an int, not a FILE *.Darren Salt
2010-02-06libv4l check shouldn't fail & abort unless --enable-libv4l is given.Darren Salt
2010-02-03Remove pointless output from stats logging; make the const variables static.Darren Salt
2009-11-30Trim trailing space & reduce space+tab.Darren Salt
2008-06-15Merge.Darren Salt
2008-06-15Backed out changeset a1dad259c8f8. In 1.1.x, deprecated functions must remain.Darren Salt
2008-05-07xine_xmalloc() deprecation: replace its use with static and non-zero size.Diego 'Flameeyes' Pettenò
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
2008-05-03Make two arrays of string become arrays of arrays of characters.Diego 'Flameeyes' Pettenò
2008-05-03Remove deprecated functions from net_buf_ctrl.c.Diego 'Flameeyes' Pettenò
2007-11-09Update FSF address on non-contributed code and COPYING files.Diego 'Flameeyes' Pettenò
For contributed code, leave whatever the version we last synced for is using to make simpler future syncs.
2007-03-17Avoid a possible floating-point exception when starting stream playback.Darren Salt
CVS patchset: 8707 CVS date: 2007/03/17 19:15:58
2005-11-28*BUGFIX*František Dvořák
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
2004-12-12huge patch ahead: reorganizing config entries with automatic conversionMichael Roitzsch
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
2004-09-23- Factor is 1.0, num_buffers is 230...Bastien Nocera
Fix video as well CVS patchset: 6997 CVS date: 2004/09/23 16:41:39
2004-09-23- Fix crashes with some input plugins when no audio output was availableBastien Nocera
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
2004-08-16* remove unused low water markMichael Roitzsch
* 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
2004-03-29remove unused variableMichael Roitzsch
CVS patchset: 6317 CVS date: 2004/03/29 19:11:30
2004-03-28the anti-yoyo hack is still needed.Thibaut Mattern
CVS patchset: 6315 CVS date: 2004/03/28 20:58:06
2004-03-28- new logic evaluate engine latency.Thibaut Mattern
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
2004-03-26Fix mutex "leak".František Dvořák
CVS patchset: 6308 CVS date: 2004/03/26 12:30:04
2004-03-13Better control buffer handling.Thibaut Mattern
Note: _x_set_speed deadlocks ! CVS patchset: 6248 CVS date: 2004/03/13 22:25:05
2004-02-16fix freezes with input plugins that play with the speed:uid86226
* 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
2004-02-12getting rid of AO_PROP_PAUSED, because it can be derived by asking the clockMichael Roitzsch
CVS patchset: 6136 CVS date: 2004/02/12 18:09:19
2003-12-05cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's ↵Daniel Caujolle-Bert
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
2003-11-26xprintf clean pass. xprintf now log into new XINE_LOG_TRACE log buffer. ↵Daniel Caujolle-Bert
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
2003-11-26lprintf cleanup, pass I.Daniel Caujolle-Bert
CVS patchset: 5796 CVS date: 2003/11/26 19:43:26
2003-11-16New stream/meta info (safe) stuff.Daniel Caujolle-Bert
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
2003-11-15more helper functions cleanup (stream info, meta info)Miguel Freitas
CVS patchset: 5731 CVS date: 2003/11/15 13:01:00
2003-10-17Allways initialize fifo size.Thibaut Mattern
Fix a problem introduced by the previous cleanup. CVS patchset: 5533 CVS date: 2003/10/17 00:35:45
2003-10-16Avoid yoyo effect with poorly interleaved streams.Thibaut Mattern
CVS patchset: 5532 CVS date: 2003/10/16 22:15:09
2003-10-15printf -> lprintfThibaut Mattern
CVS patchset: 5528 CVS date: 2003/10/15 23:47:12
2003-10-14- use the alloc callback to avoid deadlocks.Thibaut Mattern
- fix discontinuity handling. - use lprinf - cleanup CVS patchset: 5522 CVS date: 2003/10/14 22:54:45
2003-10-04Fix a deadlock.Thibaut Mattern
Patch from Ramon van der Aar <rvda@itsec-ps.nl> CVS patchset: 5434 CVS date: 2003/10/04 14:36:05
2003-08-25Reduce GCC verbosity (various prototype declaration fixes). ffmpeg, wine and ↵Daniel Caujolle-Bert
fft*post are untouched (fft: for now). CVS patchset: 5310 CVS date: 2003/08/25 21:51:37
2003-05-13support multiple callback registrationMiguel Freitas
CVS patchset: 4840 CVS date: 2003/05/13 16:38:04
2003-03-30New net_buf_ctrl.Thibaut Mattern
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
2003-02-24Reverts the detection of empty fifos.Thibaut Mattern
It caused problems with radios. CVS patchset: 4280 CVS date: 2003/02/24 01:24:19
2003-02-24- starts buffering when one fifo is empty (better for poorly interleaved ↵Thibaut Mattern
streams) - 'mplayer like' debug mode ('\r') ;) CVS patchset: 4278 CVS date: 2003/02/24 00:04:36
2003-02-23New function that should be called at the end of the stream to unpause the ↵Thibaut Mattern
engine if buffering. CVS patchset: 4269 CVS date: 2003/02/23 21:52:42
2003-02-23Always the same story.Thibaut Mattern
CVS patchset: 4267 CVS date: 2003/02/23 19:42:23
2003-02-23 - Remove constants related to fifo sizesThibaut Mattern
- 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
2003-02-23Wow, I've forgotten a big part of my patch !Thibaut Mattern
CVS patchset: 4264 CVS date: 2003/02/23 15:56:42
2003-02-18- Don't report twice the same number.Thibaut Mattern
- Report a progress even if the bitrate is not known CVS patchset: 4197 CVS date: 2003/02/18 23:15:07
2003-02-08New net_buf_ctrl strategy.Thibaut Mattern
see http://sourceforge.net/mailarchive/forum.php?thread_id=1568239&forum_id=7131 CVS patchset: 4116 CVS date: 2003/02/08 13:52:44
2003-01-29percent should not be more than 100Miguel Freitas
CVS patchset: 4035 CVS date: 2003/01/29 11:08:11
2003-01-26revert, commited by error, thibaut patch ;-)Daniel Caujolle-Bert
CVS patchset: 4017 CVS date: 2003/01/26 23:36:46