diff options
author | 2009-11-30 00:51:05 +0000 | |
---|---|---|
committer | 2009-11-30 00:51:05 +0000 | |
commit | 6967cdf013877eeca01152c1c418abb1d0d1b1eb (patch) | |
tree | c25233ccc82bf117522077eee3960c3d5a86e03b /src/lib/util | |
parent | 93671925bd9c01fd4bd1030e8960180da58e1174 (diff) |
From:CD-i Fan
I found that it needs to be slightly different if you want correctly
terminated audio streams:
/* add up the samples */
if (channelsamples > chunksamples)
file->info.audio_numsamples = stream->samples += chunksamples;
else if (channelsamples > 0)
file->info.audio_numsamples = stream->samples += channelsamples;
Otherwise extra silence will be counted at the end of the audio stream.
Not really that big an issue but a bit sloppy...
Diffstat (limited to 'src/lib/util')
-rw-r--r-- | src/lib/util/aviio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c index 4ca7079892d..d7dd74adeb1 100644 --- a/src/lib/util/aviio.c +++ b/src/lib/util/aviio.c @@ -2306,8 +2306,10 @@ static avi_error soundbuf_flush(avi_file *file, int only_flush_full) return avierr; /* add up the samples */ - if (channelsamples > 0) + if (channelsamples > chunksamples) file->info.audio_numsamples = stream->samples += chunksamples; + else if (channelsamples > 0) + file->info.audio_numsamples = stream->samples += channelsamples; /* advance past those */ processedsamples += chunksamples; |