in reply to playing video using vlc plugin

Hi awanti :)

#I see a coming bug ^_^

while(!eof(FILE) && $cur < $end) { my $buf=1024*16; read FILE, $buf, $end-$cur; $cur+=1024*16; }

I suggest you to keep the number of bytes read in a variable:
e.g.: $ln = read FILE, $buf, $size;
($size defined outside the loop and "my $buf" too)

and compute $cur with the number of bytes read, e.g.:
$cur += $ln;

In fact, the block read is not always 1024*16

The while is strange (it can work but it's stinks lol), why not simplify it with e.g.:
while(!eof(FILE))

Peace

Replies are listed 'Best First'.
Re^3: playing video using vlc plugin
by Anonymous Monk on Jan 01, 2016 at 18:03 UTC