diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-05-04 19:49:29 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-05-04 19:49:29 +0000 |
commit | 659df586719c727204513c97c243c9f14dbfa5d9 (patch) | |
tree | 404a08b7c414feb0c1193fadd3ee146fa9bc8f95 /src/mp3_decode.c | |
parent | 638817fc5b2a537b21335d8f5e429559353602a5 (diff) | |
download | mpd-659df586719c727204513c97c243c9f14dbfa5d9.tar.gz mpd-659df586719c727204513c97c243c9f14dbfa5d9.tar.xz mpd-659df586719c727204513c97c243c9f14dbfa5d9.zip |
implement input abstraction for ogg and mp3
git-svn-id: https://svn.musicpd.org/mpd/trunk@904 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/mp3_decode.c')
-rw-r--r-- | src/mp3_decode.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mp3_decode.c b/src/mp3_decode.c index 58cd62a52..cf1c9b54e 100644 --- a/src/mp3_decode.c +++ b/src/mp3_decode.c @@ -136,7 +136,7 @@ typedef struct _mp3DecodeData { int initMp3DecodeData(mp3DecodeData * data, char * file) { int ret; - while(((ret = initInputStreamFromFile(&(data->inStream),file))<0) && + while(((ret = openInputStreamFromFile(&(data->inStream),file))<0) && data->inStream.error==EINTR); if(ret<0) return -1; @@ -164,7 +164,7 @@ int fillMp3InputBuffer(mp3DecodeData * data, long offset) { unsigned char * readStart; if(offset>=0) { - seekInputStream(&(data->inStream),offset); + seekInputStream(&(data->inStream),offset,SEEK_SET); } if(offset==-1 && (data->stream).next_frame!=NULL) { @@ -179,8 +179,7 @@ int fillMp3InputBuffer(mp3DecodeData * data, long offset) { remaining = 0; } - readSize = fillBufferFromInputStream(&(data->inStream),readStart, - readSize); + readSize = readFromInputStream(&(data->inStream),readStart,1,readSize); if(readSize<=0) return -1; mad_stream_buffer(&data->stream,data->readBuffer,readSize+remaining); @@ -375,7 +374,7 @@ void mp3DecodeDataFinalize(mp3DecodeData * data) { mad_frame_finish(&data->frame); mad_stream_finish(&data->stream); - while(finishInputStream(&(data->inStream))<0 && + while(closeInputStream(&(data->inStream))<0 && data->inStream.error==EINTR); if(data->frameOffset) free(data->frameOffset); if(data->times) free(data->times); |