Skip to content

Commit 384841b

Browse files
author
Clement Champetier
committed
pyTest offset: check output nbSamples/nbFrames when rewrap
1 parent 9b78c0e commit 384841b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/pyTest/testOffset.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def testRewrapAudioPositiveOffset():
102102

103103
# check output duration
104104
assert_equals( src_audioStream.getDuration() + offset, dst_audioStream.getDuration() )
105+
assert_equals( src_audioStream.getNbSamples() + ( offset * dst_audioStream.getSampleRate() * dst_audioStream.getChannels() ), dst_audioStream.getNbSamples() )
105106

106107

107108
def testRewrapAudioNegativeOffset():
@@ -132,6 +133,7 @@ def testRewrapAudioNegativeOffset():
132133

133134
# check output duration
134135
assert_almost_equals( src_audioStream.getDuration() + offset, dst_audioStream.getDuration(), delta=0.01 )
136+
assert_equals( src_audioStream.getNbSamples() + ( offset * dst_audioStream.getSampleRate() * dst_audioStream.getChannels() ), dst_audioStream.getNbSamples() )
135137

136138

137139
def testTranscodeVideoPositiveOffset():
@@ -222,6 +224,7 @@ def testRewrapVideoPositiveOffset():
222224

223225
# check output duration
224226
assert_equals( src_videoStream.getDuration() + offset, dst_videoStream.getDuration() )
227+
assert_equals( src_videoStream.getNbFrames() + ( offset * dst_videoStream.getFps() ), dst_videoStream.getNbFrames() )
225228

226229

227230
def testRewrapVideoNegativeOffset():
@@ -252,6 +255,7 @@ def testRewrapVideoNegativeOffset():
252255

253256
# check output duration
254257
assert_equals( src_videoStream.getDuration() + offset, dst_videoStream.getDuration() )
258+
assert_equals( src_videoStream.getNbFrames() + ( offset * dst_videoStream.getFps() ), dst_videoStream.getNbFrames() )
255259

256260

257261
def testMultipleOffsetFromSameInputFile():

0 commit comments

Comments
 (0)