File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
src/AvTranscoder/mediaProperty Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -172,8 +172,8 @@ size_t AudioProperties::getTicksPerFrame() const
172
172
173
173
Rational AudioProperties::getTimeBase () const
174
174
{
175
- if ( ! _codecContext )
176
- throw std::runtime_error ( " unknown codec context" );
175
+ if ( ! _formatContext )
176
+ throw std::runtime_error ( " unknown format context" );
177
177
178
178
Rational timeBase = {
179
179
_formatContext->streams [_streamId]->time_base .num ,
@@ -193,9 +193,6 @@ double AudioProperties::getFps() const
193
193
194
194
double AudioProperties::getDuration () const
195
195
{
196
- if ( ! _formatContext )
197
- throw std::runtime_error ( " unknown format context" );
198
-
199
196
Rational timeBase = getTimeBase ();
200
197
double duration = ( timeBase.num / (double ) timeBase.den ) * _formatContext->streams [_streamId]->duration ;
201
198
return duration;
Original file line number Diff line number Diff line change @@ -337,8 +337,8 @@ std::string VideoProperties::getStartTimecodeString() const
337
337
338
338
Rational VideoProperties::getTimeBase () const
339
339
{
340
- if ( ! _codecContext )
341
- throw std::runtime_error ( " unknown codec context" );
340
+ if ( ! _formatContext )
341
+ throw std::runtime_error ( " unknown format context" );
342
342
343
343
Rational timeBase = {
344
344
_formatContext->streams [_streamId]->time_base .num ,
@@ -479,9 +479,6 @@ double VideoProperties::getFps() const
479
479
480
480
double VideoProperties::getDuration () const
481
481
{
482
- if ( ! _formatContext )
483
- throw std::runtime_error ( " unknown format context" );
484
-
485
482
Rational timeBase = getTimeBase ();
486
483
double duration = ( timeBase.num / (double ) timeBase.den ) * _formatContext->streams [_streamId]->duration ;
487
484
return duration;
You can’t perform that action at this time.
0 commit comments