mirror of https://github.com/mpv-player/mpv
Simplify: use av_fifo_space
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29166 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
446980680f
commit
690714883e
|
@ -82,7 +82,7 @@ static AVFifoBuffer *buffer;
|
|||
* If there is not enough room, the buffer is filled up
|
||||
*/
|
||||
static int write_buffer(unsigned char* data, int len) {
|
||||
int free = BUFFSIZE - av_fifo_size(buffer);
|
||||
int free = av_fifo_space(buffer);
|
||||
if (len > free) len = free;
|
||||
return av_fifo_generic_write(buffer, data, len, NULL);
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ static void audio_resume(void) {
|
|||
}
|
||||
|
||||
static int get_space(void) {
|
||||
return BUFFSIZE - av_fifo_size(buffer);
|
||||
return av_fifo_space(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,7 +67,7 @@ static unsigned char volume=SDL_MIX_MAXVOLUME;
|
|||
#endif
|
||||
|
||||
static int write_buffer(unsigned char* data,int len){
|
||||
int free = BUFFSIZE - av_fifo_size(buffer);
|
||||
int free = av_fifo_space(buffer);
|
||||
if (len > free) len = free;
|
||||
return av_fifo_generic_write(buffer, data, len, NULL);
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ static void audio_resume(void)
|
|||
|
||||
// return: how many bytes can be played without blocking
|
||||
static int get_space(void){
|
||||
return BUFFSIZE - av_fifo_size(buffer);
|
||||
return av_fifo_space(buffer);
|
||||
}
|
||||
|
||||
// plays 'len' bytes of 'data'
|
||||
|
|
Loading…
Reference in New Issue