Mercurial > audlegacy-plugins
comparison src/aac/src/libmp4.c @ 690:0305b3165a01 trunk
[svn] - ringbuffering underrun fixups -- found with purify
author | nenolod |
---|---|
date | Tue, 20 Feb 2007 06:31:29 -0800 |
parents | 9e85901ac6c0 |
children | a77e766e332d |
comparison
equal
deleted
inserted
replaced
689:9e85901ac6c0 | 690:0305b3165a01 |
---|---|
696 } | 696 } |
697 xmmstitle = g_strdup(g_basename(temp)); | 697 xmmstitle = g_strdup(g_basename(temp)); |
698 | 698 |
699 bufferconsumed = aac_probe(buffer, buffervalid); | 699 bufferconsumed = aac_probe(buffer, buffervalid); |
700 if(bufferconsumed) { | 700 if(bufferconsumed) { |
701 memmove(buffer, &buffer[bufferconsumed], buffervalid-bufferconsumed); | 701 memmove(buffer, &buffer[bufferconsumed], buffervalid); |
702 buffervalid -= bufferconsumed; | 702 buffervalid -= bufferconsumed; |
703 buffervalid += vfs_fread(&buffer[buffervalid], 1, | 703 buffervalid += vfs_fread(&buffer[buffervalid], 1, |
704 BUFFER_SIZE-buffervalid, file); | 704 BUFFER_SIZE-buffervalid, file); |
705 bufferconsumed = 0; | 705 bufferconsumed = 0; |
706 } | 706 } |
730 faacDecFrameInfo finfo; | 730 faacDecFrameInfo finfo; |
731 unsigned long samplesdecoded; | 731 unsigned long samplesdecoded; |
732 char* sample_buffer = NULL; | 732 char* sample_buffer = NULL; |
733 | 733 |
734 if(bufferconsumed > 0){ | 734 if(bufferconsumed > 0){ |
735 memmove(buffer, &buffer[bufferconsumed], buffervalid-bufferconsumed); | 735 memmove(buffer, &buffer[bufferconsumed], buffervalid); |
736 buffervalid -= bufferconsumed; | 736 buffervalid -= bufferconsumed; |
737 buffervalid += vfs_fread(&buffer[buffervalid], 1, | 737 buffervalid += vfs_fread(&buffer[buffervalid], 1, |
738 BUFFER_SIZE-buffervalid, file); | 738 BUFFER_SIZE-buffervalid, file); |
739 bufferconsumed = 0; | 739 bufferconsumed = 0; |
740 } | 740 } |