Videos: Don't transcode the same file twice #703
This commit is contained in:
parent
1321192eff
commit
e3190a9f3f
1 changed files with 8 additions and 0 deletions
|
@ -269,6 +269,10 @@ func (c *Convert) ToJpeg(image *MediaFile) (*MediaFile, error) {
|
|||
defer c.cmdMutex.Unlock()
|
||||
}
|
||||
|
||||
if fs.FileExists(jpegName) {
|
||||
return NewMediaFile(jpegName)
|
||||
}
|
||||
|
||||
// Fetch command output.
|
||||
var out bytes.Buffer
|
||||
var stderr bytes.Buffer
|
||||
|
@ -350,6 +354,10 @@ func (c *Convert) ToAvc(video *MediaFile) (*MediaFile, error) {
|
|||
defer c.cmdMutex.Unlock()
|
||||
}
|
||||
|
||||
if fs.FileExists(avcName) {
|
||||
return NewMediaFile(avcName)
|
||||
}
|
||||
|
||||
// Fetch command output.
|
||||
var out bytes.Buffer
|
||||
var stderr bytes.Buffer
|
||||
|
|
Loading…
Reference in a new issue