diff options
author | jstebbins <[email protected]> | 2010-04-02 23:58:24 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-04-02 23:58:24 +0000 |
commit | 7397025b5095f6154f69b5529a79791d5588d935 (patch) | |
tree | 0ab6e53e6f7a6bf3b55eddb8143827dcd0765713 /libhb/fifo.c | |
parent | fc299fb336fa32722f04e529e987c27d67dddb26 (diff) |
fix audio detection problem during scan of ffmpeg audio sources
audio frames can be larger than their container packet sizes, but during
scan, we only feed one container packet to the decoder, then reset
the decoder and try the next packet. so the audio is never detected.
as buffers are tested, they are added to a cache. the entire cache is
passed to the decoder to scan for info. the cache is limited to 4KB.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3195 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/fifo.c')
-rw-r--r-- | libhb/fifo.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libhb/fifo.c b/libhb/fifo.c index c72b4e10b..3aeeea273 100644 --- a/libhb/fifo.c +++ b/libhb/fifo.c @@ -235,6 +235,23 @@ hb_fifo_t * hb_fifo_init( int capacity, int thresh ) return f; } +int hb_fifo_size_bytes( hb_fifo_t * f ) +{ + int ret = 0; + hb_buffer_t * link; + + hb_lock( f->lock ); + link = f->first; + while ( link ) + { + ret += link->size; + link = link->next; + } + hb_unlock( f->lock ); + + return ret; +} + int hb_fifo_size( hb_fifo_t * f ) { int ret; |