Questions tagged [buffering]

Buffering is a process of temporarily storing data while it is being moved from one place to another.

Buffering is a process of temporarily storing data while it is being moved from one place to another. A buffer often adjusts timing by implementing a queue (or FIFO) algorithm in memory, simultaneously writing data into the queue at one rate and reading it at another rate.

Use this tag for programming questions related to data buffer and the process of buffering.

Source: Wikipedia

493 questions
6
votes
1 answer

Is it possible to set the buffer size of pipes when using asyncio subprocesses?

I'm writing a rather complex script that is using asyncio.create_subprocess_exec(sub_cmd, *sub_cmd_args, stdout=PIPE, stderr=PIPE) to wrap around another Python program -- that I can't modify permanently or otherwise include directly -- to capture…
JFlo
  • 658
  • 6
  • 12
6
votes
2 answers

Detect when video is buffering, if so display gif

I'am wondering if there's a way to display a .gif while the video is buffering. I'am using the HTML5 Video Tag, within this is there a way to detect when a video is buffering, if not is there an alternative? I've looked at: How to detect when video…
Gerwin
  • 1,572
  • 5
  • 23
  • 51
6
votes
1 answer

How to avoid buffering in the Python fileinput library

I've seen this question asked here, but the answers given did not work in my case and was marked duplicate. python -u does not work for stdin in Python 3. sys.stdin = sys.stdin.detach() throws a ValueError: underlying buffer has been detached. None…
dpyro
  • 1,559
  • 2
  • 13
  • 19
6
votes
3 answers

Perl, disable buffering input

There is a file: :~$ cat fff qwerty asdf qwerty zxcvb There is a script: :~$ cat 1.pl #!/usr/bin/perl print The command works as expected: :~$ cat fff | perl -e 'system("./1.pl")' qwerty asdf qwerty zxcvb But this command will not work as…
drlexa
  • 131
  • 1
  • 2
  • 5
6
votes
2 answers

How can I buffer my Java input/output/file streams properly?

I'm writing an application that needs to send a file over the network. I've only been taught how to use standard java.net and java.io classes so far (in my first year of college) so I have no experience with java.nio and netty and all those nice…
ldam
  • 4,412
  • 6
  • 45
  • 76
6
votes
4 answers

Statement before fork() printing twice

I was experimenting with fork() and re-direction to check whether the re-directions done in the parent apply to the child too. I wrote the following simple program #include #include #include int main () { freopen(…
Pavan Manjunath
  • 27,404
  • 12
  • 99
  • 125
6
votes
1 answer

Android, How to display the buffering % from onBufferingUpdate

I have a Media player service that plays a internet stream, but I'm having problems on how to display in my xml the buffering percentage, at the moment I'm just displaying a message since all the ways I have try it gave me a static long number. Here…
zvzej
  • 6,276
  • 7
  • 33
  • 41
5
votes
4 answers

Does ob_start affect performance of files stored on CDN?

I use object buffering to buffer the output of my php pages using ob_start('ob_gzhandler');. Does this affect the performance of the files stored in CDN? The reason for asking this question is because, one of the site indicated the following about…
Abishek
  • 11,191
  • 19
  • 72
  • 111
5
votes
2 answers

Disabling output buffering in PHP

I have an object for tasks and on __deconstruct(), it's meant to run some of the lengthier cleanup tasks after the rest of the page has already loaded. Unfortunately, it buffers the output and won't send it until after the tasks are finished…
Apropos
  • 508
  • 5
  • 15
5
votes
3 answers

In php, I want to download an s3 file to the browser without storing it on my server

I've got files on Amazon's S3. They are named with a unique ID so there are no duplicates. I am accessing them using an authorized URL. I need to be able to pass them through to the browser, but I need to rename them. Right now I'm using fopen, but…
Corey
  • 1,977
  • 4
  • 28
  • 42
5
votes
3 answers

Triggering an HTML5 audio track to play whenever it has loaded

I'm trying to play an HTML5 audio track a few seconds after the page has loaded using the .play() JavaScript function. Sometimes, when the audio loads slowly, and .play() is triggered when the player looks like this: The audio does not play when it…
KemanoThief
  • 617
  • 8
  • 23
5
votes
0 answers

Control AVPlayer Buffer

I want to prevent a mp3 or audio stream from buffering past a certain amount of seconds. Apple's documentation for controlling buffer doesn't seem to be very helpful. I tried using AVPlayerItem's preferredForwardBufferDuration and setting…
fnw1989
  • 121
  • 5
5
votes
1 answer

Implement Double Buffer in C

So I have a very high data acquisition rate of 16MB/s. I am reading 4MB of data into a buffer from a device file and then processing it. However, this method of writing then reading was to slow for the project. I would like to implement a double…
5
votes
1 answer

What is the potential benefit of allowing C++ and C streams to buffer independently?

C++ iostreams provides control over whether C++ streams must be synchronized with C streams via std::ios_base::sync_with_stdio(). Turning off stream synchronization allows the standard library implementation to use independent unsynchronized buffers…
Praxeolitic
  • 22,455
  • 16
  • 75
  • 126
5
votes
0 answers

Can I play audio as arrayBuffer in ionic using ng-cordova media plugin?

If we use the code below: var media = new Media('url://...mp3', null, null, mediaStatusCallback); media.play(); Well this will first download the hole mp3 file, then play it. But the problem is if we have a large size audio file it will be stuck…
sami
  • 231
  • 2
  • 8