diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-11-23 13:25:04 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-11-23 13:25:04 +0000 |
| commit | bab2a1cf99c58dcb598fed383015b1937d3ea07f (patch) | |
| tree | 1cb683cc5dfc29ea9fd254c88da299fb13b69f54 /src | |
| parent | 13b2b8f48f3f1a22277a760a7fada980b9f37677 (diff) | |
Tidy up a bit.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/ffmpeg.cc | 16 | ||||
| -rw-r--r-- | src/lib/ffmpeg.h | 1 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index bbf853af1..3b894a6ff 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -77,10 +77,6 @@ avio_read_wrapper (void* data, uint8_t* buffer, int amount) static int64_t avio_seek_wrapper (void* data, int64_t offset, int whence) { - if (whence == AVSEEK_SIZE) { - return reinterpret_cast<FFmpeg*>(data)->avio_length (); - } - return reinterpret_cast<FFmpeg*>(data)->avio_seek (offset, whence); } @@ -104,7 +100,7 @@ FFmpeg::setup_general (bool long_probe) av_dict_set (&options, "probesize", lexical_cast<string> (5 * 60 * 1e6).c_str(), 0); } - if (avformat_open_input (&_format_context, _ffmpeg_content->path(0).string().c_str(), 0, &options) < 0) { + if (avformat_open_input (&_format_context, 0, 0, &options) < 0) { throw OpenFileError (_ffmpeg_content->path(0).string ()); } @@ -192,11 +188,9 @@ FFmpeg::avio_read (uint8_t* buffer, int const amount) int64_t FFmpeg::avio_seek (int64_t const pos, int whence) { + if (whence == AVSEEK_SIZE) { + return _file_group.length (); + } + return _file_group.seek (pos, whence); } - -int64_t -FFmpeg::avio_size () -{ - return _file_group.length (); -} diff --git a/src/lib/ffmpeg.h b/src/lib/ffmpeg.h index c94b8d8ac..182ee634b 100644 --- a/src/lib/ffmpeg.h +++ b/src/lib/ffmpeg.h @@ -52,7 +52,6 @@ public: int avio_read (uint8_t *, int); int64_t avio_seek (int64_t, int); - int64_t avio_length (); protected: AVCodecContext* video_codec_context () const; |
