Skip to content

Commit ad77a76

Browse files
committed
InputStream: get duration from video properties instead of avFormatContext
1 parent a1f827f commit ad77a76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/AvTranscoder/stream/InputStream.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ AVMediaType InputStream::getStreamType() const
123123

124124
double InputStream::getDuration() const
125125
{
126-
return 1.0 * _inputFile->getFormatContext().getDuration() / AV_TIME_BASE;
126+
// @todo: return stream duration, depending on its type (instead of format duration)
127+
return _inputFile->getProperties().getDuration();
127128
}
128129

129130
void InputStream::addPacket( AVPacket& packet )

0 commit comments

Comments
 (0)