File tree Expand file tree Collapse file tree 4 files changed +4
-10
lines changed Expand file tree Collapse file tree 4 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ class AvExport IInputStream
31
31
*/
32
32
virtual const StreamProperties& getProperties () const = 0;
33
33
virtual size_t getStreamIndex () const = 0;
34
- virtual float getDuration () const = 0; // /< Get duration of the stream, in seconds
35
34
36
35
// @{
37
36
/* *
Original file line number Diff line number Diff line change @@ -113,11 +113,6 @@ const StreamProperties& InputStream::getProperties() const
113
113
return _inputFile->getProperties ().getStreamPropertiesWithIndex ( _streamIndex );
114
114
}
115
115
116
- float InputStream::getDuration () const
117
- {
118
- return _inputFile->getProperties ().getStreamPropertiesWithIndex ( _streamIndex ).getDuration ();
119
- }
120
-
121
116
void InputStream::addPacket ( const AVPacket& packet )
122
117
{
123
118
// Do not cache data if the stream is declared as unused in process
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ class AvExport InputStream : public IInputStream
26
26
27
27
const StreamProperties& getProperties () const ;
28
28
size_t getStreamIndex () const { return _streamIndex; }
29
- float getDuration () const ;
30
29
31
30
VideoCodec& getVideoCodec ();
32
31
AudioCodec& getAudioCodec ();
Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ bool StreamTranscoder::processFrame()
383
383
}
384
384
else if ( _offset < 0 )
385
385
{
386
- const bool endOfStream = _outputStream->getStreamDuration () >= ( _inputStream->getDuration () + _offset );
386
+ const bool endOfStream = _outputStream->getStreamDuration () >= ( _inputStream->getProperties (). getDuration () + _offset );
387
387
if ( endOfStream )
388
388
{
389
389
LOG_INFO ( " End of negative offset" )
@@ -516,10 +516,11 @@ float StreamTranscoder::getDuration() const
516
516
{
517
517
if ( _inputStream )
518
518
{
519
- const float totalDuration = _inputStream->getDuration () + _offset;
519
+ const StreamProperties& streamProperties = _inputStream->getProperties ();
520
+ const float totalDuration = streamProperties.getDuration () + _offset;
520
521
if ( totalDuration < 0 )
521
522
{
522
- LOG_WARN ( " Offset of " << _offset << " s applied to a stream with a duration of " << _inputStream-> getDuration () << " s. Set its duration to 0s." )
523
+ LOG_WARN ( " Offset of " << _offset << " s applied to a stream with a duration of " << streamProperties. getDuration () << " s. Set its duration to 0s." )
523
524
return 0 .;
524
525
}
525
526
return totalDuration;
You can’t perform that action at this time.
0 commit comments