use offset, and a bunch of debugger crud
git-svn-id: https://svn.musicpd.org/mpd/trunk@318 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
@@ -97,6 +97,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
|
|||||||
float * seekTable;
|
float * seekTable;
|
||||||
long seekTableEnd = -1;
|
long seekTableEnd = -1;
|
||||||
int seekPositionFound = 0;
|
int seekPositionFound = 0;
|
||||||
|
long offset;
|
||||||
|
|
||||||
fh = fopen(dc->file,"r");
|
fh = fopen(dc->file,"r");
|
||||||
if(!fh) {
|
if(!fh) {
|
||||||
@@ -187,6 +188,8 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dur = mp4ff_get_sample_duration(mp4fh,track,sampleId);
|
dur = mp4ff_get_sample_duration(mp4fh,track,sampleId);
|
||||||
|
offset = mp4ff_get_sample_offset(mp4fh,track,sampleId);
|
||||||
|
dur-=offset;
|
||||||
|
|
||||||
if(sampleId>seekTableEnd) {
|
if(sampleId>seekTableEnd) {
|
||||||
seekTable[sampleId] = time;
|
seekTable[sampleId] = time;
|
||||||
@@ -222,6 +225,11 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
|
|||||||
|
|
||||||
if(sampleCount>0) initial =0;
|
if(sampleCount>0) initial =0;
|
||||||
sampleBufferLen = sampleCount*2;
|
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) {
|
while(sampleBufferLen>0 && !dc->seek) {
|
||||||
size_t size = sampleBufferLen>CHUNK_SIZE-chunkLen ?
|
size_t size = sampleBufferLen>CHUNK_SIZE-chunkLen ?
|
||||||
|
Reference in New Issue
Block a user