ignore position while seeking in mplayer
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 20 Oct 2009 22:26:17 +0000 (00:26 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 20 Oct 2009 22:26:17 +0000 (00:26 +0200)
bin/mplayer.pl

index cf69ec5..ac1207d 100755 (executable)
@@ -632,8 +632,8 @@ while ( my $line = <$from_mplayer> ) {
                $t = time;
        }
 
-       if ( $line =~ m{DEMUX} ) {
-               $pos = $1 if $line =~ m{pts=(\d+\.\d+)};
+       if ( $line =~ m{DEMUX.+pts=(\d+\.\d+)} ) {
+               $pos = $1 if $1 > 0.2; # mplayer demuxer report fake position while seeking
        } elsif ( $line =~ m{Exiting} ) {
                exit;
        } elsif ( $line =~ m{ANS_(\w+)=(\S+)} ) {