Manolo R.G. wrote:

.  what is the right calculation for this time value then ?
    
Try if these lines returns the same value:

log.info("x-duration: " + stream.getStreamFlow().getTotalStreamTime());
log.info("current time: " + (new Date()).getTime());

I don't know what stream.getStreamFlow().getTotalStreamTime() should 
return but as it's returning the milliseconds since 1 january 1970 
(java.util.Date function getTime()).

If you get the time in milliseconds when the stream starts and when it 
closes, you could get the duration substracting the last value from the 
first and passing then to seconds or other time measure.



  
it seems formatting the result of getTotalStreamTime is a mystery as im unsure what exactly the value is, i found in the output of toString, StreamFlow has this

[EMAIL PROTECTED] BT = -6775, SBT = 0, SDT = 0, SST = 6775]

6775 becomes 6 seconds which is pretty close to what my stream duration was, it does however use the getSegmentStreamTime however it does a microtime comparison against the variable segementStartTime ?

public long getSegmentStreamTime() {
        if (segmentStartTime == 0) {
            return 0;
        }
        return System.currentTimeMillis() - segmentStartTime;
    }
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to