1 // ------------------------------------------------
6 // (c) 2002-3 peercast.org
7 // ------------------------------------------------
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 // ------------------------------------------------
21 #include "chkMemoryLeak.h"
22 #define DEBUG_NEW new(__FILE__, __LINE__)
26 // ------------------------------------------
27 void NSVStream::readEnd(Stream &,Channel *)
31 // ------------------------------------------
32 void NSVStream::readHeader(Stream &,Channel *)
35 // ------------------------------------------
36 int NSVStream::readPacket(Stream &in,Channel *ch)
40 if (ch->icyMetaInterval)
43 int rlen = ch->icyMetaInterval;
48 if (rl > ChanMgr::MAX_METAINT)
49 rl = ChanMgr::MAX_METAINT;
51 pack.init(ChanPacket::T_DATA,pack.data,rl,ch->streamPos);
52 in.read(pack.data,pack.len);
54 ch->checkReadDelay(pack.len);
55 ch->streamPos+=pack.len;
64 if (len*16 > 1024) len = 1024/16;
67 ch->processMp3Metadata(buf);
72 pack.init(ChanPacket::T_DATA,pack.data,ChanMgr::MAX_METAINT,ch->streamPos);
73 in.read(pack.data,pack.len);
75 ch->checkReadDelay(pack.len);
77 ch->streamPos += pack.len;