|
@@ -281,9 +281,22 @@ void AsyncPacketBufferedInputStream< Stream, Packet >::_requestNext()
|
|
IResettable* resettable = dynamic_cast< IResettable* >( s );
|
|
IResettable* resettable = dynamic_cast< IResettable* >( s );
|
|
if( resettable )
|
|
if( resettable )
|
|
{
|
|
{
|
|
|
|
+ IPositionable< U32 >* positionable = dynamic_cast< IPositionable< U32 >* >( &Deref( stream ) );
|
|
|
|
+ U32 pos;
|
|
|
|
+ if(positionable)
|
|
|
|
+ pos = positionable->getPosition();
|
|
|
|
+
|
|
resettable->reset();
|
|
resettable->reset();
|
|
isEOS = false;
|
|
isEOS = false;
|
|
this->mNumRemainingSourceElements = mNumTotalSourceElements;
|
|
this->mNumRemainingSourceElements = mNumTotalSourceElements;
|
|
|
|
+
|
|
|
|
+ if( positionable )
|
|
|
|
+ {
|
|
|
|
+ positionable->setPosition(pos);
|
|
|
|
+ U32 dur = stream->getDuration();
|
|
|
|
+ if(dur != 0) //avoiding division by zero? not needed, probably
|
|
|
|
+ this->mNumRemainingSourceElements -= (U32)(mNumTotalSourceElements*(F32)pos/dur);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if( isEOS )
|
|
else if( isEOS )
|