 				{
 					// Place any bytes left over (not divisible by 16) into our encrypted buffer
 					// to decrypt later, when we have more bytes
-					tmp.position = bytesToRead;
-					tmp.readBytes( _encryptedDataBuffer );
-					tmp.length = bytesToRead;
+					tmpBuffer.position = bytesToRead;
+					tmpBuffer.readBytes( _encryptedDataBuffer );
+					tmpBuffer.length = bytesToRead;
 				}
 				else
 				{

				
				// Set up the IV for our next set of bytes
				_decryptionIV = new ByteArray();
				tmp.position = bytesToRead - 16;
				tmp.readBytes( _decryptionIV );
				
				// Aaaaand...decrypt!
				key.decrypt( tmp, currentIV );
			}
			
			// If it's AAC, process it.
			if(AACParser.probe(tmp))
			{
				//trace("GOT AAC " + tmp.bytesAvailable);
				var aac:AACParser = new AACParser();
				aac.parse(tmp, _fragReadHandler);
				//trace("    - returned " + _fragReadBuffer.length + " bytes!");
				_fragReadBuffer.position = 0;
				return _fragReadBuffer;
			}
			
			var buffer:ByteArray = new ByteArray();
			_buffer = buffer;
			_converter.appendBytes(tmp);
			if ( flush ) _converter.flush();
			_buffer = null;
			buffer.position = 0;
			
			return buffer;
		}
		

			
			var elapsed:Number = _segmentLastSeconds - _segmentBeginSeconds;
			
			if(elapsed <= 0.0 && _extendedIndexHandler)
			{
				elapsed = _extendedIndexHandler.getTargetSegmentDuration(); // XXX fudge hack!
			}
			
			dispatchEvent(new HTTPStreamingEvent(HTTPStreamingEvent.FRAGMENT_DURATION, false, false, elapsed));
			
