diff options
Diffstat (limited to 'src/plugins/Input/ffmpeg')
| -rw-r--r-- | src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 12 | ||||
| -rw-r--r-- | src/plugins/Input/ffmpeg/decoder_ffmpeg.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp index 919830cfc..12e6d16ab 100644 --- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp +++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp @@ -44,7 +44,7 @@ DecoderFFmpeg::DecoderFFmpeg(QObject *parent, DecoderFactory *d, Output *o, cons freq = 0; bitrate = 0; seekTime = -1.0; - totalTime = 0.0; + m_totalTime = 0.0; chan = 0; output_size = 0; ic = 0; @@ -122,7 +122,7 @@ bool DecoderFFmpeg::initialize() chan = 0; output_size = 0; seekTime = -1.0; - totalTime = 0.0; + m_totalTime = 0.0; if (!output_buf) output_buf = new char[globalBufferSize]; @@ -153,7 +153,7 @@ bool DecoderFFmpeg::initialize() if (avcodec_open(c, codec) < 0) return FALSE; - totalTime = ic->duration/AV_TIME_BASE; + m_totalTime = ic->duration * 1000 / AV_TIME_BASE; configure(c->sample_rate, c->channels, 16); @@ -166,12 +166,12 @@ bool DecoderFFmpeg::initialize() } -qint64 DecoderFFmpeg::lengthInSeconds() +qint64 DecoderFFmpeg::totalTime() { if (! inited) return 0; - return totalTime; + return m_totalTime; } @@ -212,7 +212,7 @@ void DecoderFFmpeg::run() if (seekTime >= 0.0) { int64_t timestamp; - timestamp = int64_t(seekTime)*AV_TIME_BASE; + timestamp = int64_t(seekTime)*AV_TIME_BASE/1000; if (ic->start_time != AV_NOPTS_VALUE) timestamp += ic->start_time; av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD); diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.h b/src/plugins/Input/ffmpeg/decoder_ffmpeg.h index ad4ab00b3..5c789d24d 100644 --- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.h +++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.h @@ -50,7 +50,7 @@ public: // Standard Decoder API bool initialize(); - qint64 lengthInSeconds(); + qint64 totalTime(); void seek(qint64); void stop(); @@ -77,7 +77,7 @@ private: long freq, bitrate; int chan; qint64 output_size; - qint64 totalTime, seekTime; + qint64 m_totalTime, seekTime; QString m_path; }; |
