projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
07e378f
)
Copy the mtime from the oldest source file to the file created by ffmpeg
author
Ivan Kozik
<ivan@ludios.org>
Thu, 20 Nov 2014 06:25:12 +0000
(06:25 +0000)
committer
Ivan Kozik
<ivan@ludios.org>
Thu, 20 Nov 2014 06:39:07 +0000
(06:39 +0000)
Fixes #4245
youtube_dl/postprocessor/ffmpeg.py
patch
|
blob
|
history
diff --git
a/youtube_dl/postprocessor/ffmpeg.py
b/youtube_dl/postprocessor/ffmpeg.py
index f3f2743c078db157c187114760fbf65f6587e662..d44de84cf1698623b9be19fe640600609dc1a704 100644
(file)
--- a/
youtube_dl/postprocessor/ffmpeg.py
+++ b/
youtube_dl/postprocessor/ffmpeg.py
@@
-79,6
+79,7
@@
class FFmpegPostProcessor(PostProcessor):
files_cmd = []
for path in input_paths:
files_cmd.extend(['-i', encodeFilename(path, True)])
files_cmd = []
for path in input_paths:
files_cmd.extend(['-i', encodeFilename(path, True)])
+ oldest_mtime = min(os.stat(path).st_mtime for path in input_paths)
cmd = ([self._executable, '-y'] + files_cmd
+ [encodeArgument(o) for o in opts] +
[encodeFilename(self._ffmpeg_filename_argument(out_path), True)])
cmd = ([self._executable, '-y'] + files_cmd
+ [encodeArgument(o) for o in opts] +
[encodeFilename(self._ffmpeg_filename_argument(out_path), True)])
@@
-91,6
+92,7
@@
class FFmpegPostProcessor(PostProcessor):
stderr = stderr.decode('utf-8', 'replace')
msg = stderr.strip().split('\n')[-1]
raise FFmpegPostProcessorError(msg)
stderr = stderr.decode('utf-8', 'replace')
msg = stderr.strip().split('\n')[-1]
raise FFmpegPostProcessorError(msg)
+ os.utime(out_path, (oldest_mtime, oldest_mtime))
if self._deletetempfiles:
for ipath in input_paths:
os.remove(ipath)
if self._deletetempfiles:
for ipath in input_paths:
os.remove(ipath)