Changeset 29018

Show
Ignore:
Timestamp:
02.05.2014 10:29:52 (5 years ago)
Author:
jmt12
Message:

Fixing bug where plugin tried to generating streaming video of filetype 'disabled' is streaming was set to disabled

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/video-and-audio/trunk/src/perllib/plugins/AudioPlugin.pm

    r28369 r29018  
    4141 
    4242my $enable_streaming_list = 
    43     [{'name' => "disabled", 'desc' => "Do not create any audio file optimised for streaming over the Internet."}, 
     43    [{'name' => "disabled", 'desc' => "Do not create any audio file optimised for streaming over the Internet."}, # Don't move this entry - it's used as a sentinel value below 
    4444     {'name' => "flv", 'desc' => "Uses the FLV format for streaming media. Better to target old computers."}, 
    4545     {'name' => "mp4", 'desc' => "Uses the MP4 container with H264 and AAC codecs. Better quality at very low bitrates but more ressources intensive."}, 
     
    7777        'type' => "enum", 
    7878        'list' => $enable_streaming_list, 
    79     'deft' => "disabled", 
    80     'reqd' => "no" }  
     79    'deft' => @{$enable_streaming_list}[0]->{'name'}, 
     80    'reqd' => "no" } 
    8181 
    8282]; 
     
    117117    my $self = shift (@_); 
    118118    my ($verbosity, $outhandle, $failhandle) = @_; 
     119 
     120    if ($self->{'enable_streaming'} eq @{$enable_streaming_list}[0]->{'name'}) 
     121    { 
     122      print $outhandle "!Warning! AudioPlugin will generate no streamable audio as format set to \'disabled\'\n"; 
     123    } 
    119124 
    120125    $self->SUPER::init(@_); 
     
    317322    = ($convertto_regenerated) ? "regenerate_general_cmd" : "run_cached_general_cmd"; 
    318323 
    319     if ($self->{'enable_streaming'}) { 
    320  
     324    if ($self->{'enable_streaming'}) 
     325    { 
     326      # The first entry in the "enabled_streaming_list" array should be "disabled" 
     327      if ($self->{'enable_streaming'} ne @{$enable_streaming_list}[0]->{'name'}) 
     328      { 
    321329    my $enable_streaming = $self->{'enable_streaming'}; 
    322330 
     
    353361        = $self->$optionally_run_general_cmd($stream_cmd,$ifilename,$mp_filename,$streamable_options); 
    354362     
    355     if (!$streamable_had_error) { 
    356          
    357         my $streamable_url = $mp_file; 
    358         my $streamable_url_safe = $self->url_safe($streamable_url); 
    359          
    360         $doc_obj->add_utf8_metadata ($section, "streamableaudio", $streamable_url_safe); 
    361         $doc_obj->associate_file($mp_filename,$mp_file,"audio/mpeg", 
    362                      $section); 
    363     } 
    364      
     363    if (!$streamable_had_error) 
     364        { 
     365          my $streamable_url = $mp_file; 
     366          my $streamable_url_safe = $self->url_safe($streamable_url); 
     367 
     368          $doc_obj->add_utf8_metadata ($section, "streamableaudio", $streamable_url_safe); 
     369          $doc_obj->associate_file($mp_filename,$mp_file,"audio/mpeg", $section); 
     370    } 
     371 
    365372    # The following aren't currently used 
    366      
    367373    $self->{'mp_file'} = $mp_file; 
    368374    $self->{'mp_filename'} = $mp_filename; 
    369     } 
    370  
    371  
     375      } 
     376    } 
    372377    return $type; 
    373378}