aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-03-20 00:54:20 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-03-20 00:54:20 +0000
commit61b9e2fc478f11aa4fe54ca7fe6995b145e0fa63 (patch)
treecfb2162eaf2962c529c43d62778a69658aac75f1
parent6100ca86a3e304172bdfbd27b37718ed8dc9c924 (diff)
downloadmpd-61b9e2fc478f11aa4fe54ca7fe6995b145e0fa63.tar.gz
mpd-61b9e2fc478f11aa4fe54ca7fe6995b145e0fa63.tar.xz
mpd-61b9e2fc478f11aa4fe54ca7fe6995b145e0fa63.zip
use offset, and a bunch of debugger crud
git-svn-id: https://svn.musicpd.org/mpd/trunk@318 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/mp4_decode.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mp4_decode.c b/src/mp4_decode.c
index 71df9daa7..16821b179 100644
--- a/src/mp4_decode.c
+++ b/src/mp4_decode.c
@@ -97,6 +97,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
float * seekTable;
long seekTableEnd = -1;
int seekPositionFound = 0;
+ long offset;
fh = fopen(dc->file,"r");
if(!fh) {
@@ -187,6 +188,8 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
}
dur = mp4ff_get_sample_duration(mp4fh,track,sampleId);
+ offset = mp4ff_get_sample_offset(mp4fh,track,sampleId);
+ dur-=offset;
if(sampleId>seekTableEnd) {
seekTable[sampleId] = time;
@@ -222,6 +225,11 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if(sampleCount>0) initial =0;
sampleBufferLen = sampleCount*2;
+
+ sampleBuffer+=offset*channels*2;
+
+ printf("dur=%li offset=%li frameInfo.samples=%li\n",dur,offset,
+ frameInfo.samples);
while(sampleBufferLen>0 && !dc->seek) {
size_t size = sampleBufferLen>CHUNK_SIZE-chunkLen ?