Fix missing audio artwork metadata on multiple exports (#340)

When the metadata filter is applied on an `Audio` media, the `artwork`
parameter was being unset from the metadata array.

Saving the same `Audio` instance into multiple formats generated the
correct commands for the first export, but the subsequent commands were
missing the `artwork` parameter.

This commit fixes this issue by copying (by value) the `metaArr`
property to a local variable each time the filter is applied.
This commit is contained in:
Sébastien Nikolaou 2017-04-12 20:40:31 +03:00 committed by Romain Biard
commit e8b247891b
2 changed files with 11 additions and 7 deletions

View file

@ -41,6 +41,7 @@ class AudioMetadataTest extends TestCase
$filters = new AudioFilters($audio);
$filters->addMetadata(array('genre' => 'Some Genre', 'artwork' => "/path/to/file.jpg"));
$this->assertEquals(array(0 => "-i", 1 => "/path/to/file.jpg", 2 => "-map", 3 => "0", 4 => "-map", 5 => "1", 6 => "-metadata", 7 => "genre=Some Genre"), $capturedFilter->apply($audio, $format));
$this->assertEquals(array(0 => "-i", 1 => "/path/to/file.jpg", 2 => "-map", 3 => "0", 4 => "-map", 5 => "1", 6 => "-metadata", 7 => "genre=Some Genre"), $capturedFilter->apply($audio, $format));
}
public function testRemoveMetadata()