Changeset 22363

Show
Ignore:
Timestamp:
07.07.2010 13:56:37 (10 years ago)
Author:
ak19
Message:

Adding in the adjustments to the mediainfoogv plugin that were mailed to Arnaud Ivan

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/MediainfoOGVPlugin.pm

    r22362 r22363  
    144144 
    145145    # execute the mediainfo command and store the output of execution in $videodata 
    146     my $video_metadata = `$command`; 
     146    # my $video_metadata = `$command`; # backticks operator way 
     147    # Another way to execute the command: better experience with this than 
     148with backticks operator above: 
     149    # use open() to read the output of executing the command (which is 
     150piped through to a handle using the | operator) 
     151    my $video_metadata; 
     152    if (open(VMIN,"$command|")) { 
     153        my $line; 
     154 
     155    # we read a line of output at a time 
     156        while (defined ($line=<VMIN>)) { 
     157            #print STDERR "***** line = $line\n"; 
     158 
     159            $video_metadata .= $line; 
     160        } 
     161 
     162        close(VMIN); 
     163    }  
     164 
    147165    print $outhandle "$video_metadata\n" if ($verbosity > 2); 
    148166