From: Carl Hetherington Date: Sat, 23 Nov 2013 13:25:04 +0000 (+0000) Subject: Tidy up a bit. X-Git-Tag: v2.0.48~1112 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=bab2a1cf99c58dcb598fed383015b1937d3ea07f;p=dcpomatic.git Tidy up a bit. --- 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(data)->avio_length (); - } - return reinterpret_cast(data)->avio_seek (offset, whence); } @@ -104,7 +100,7 @@ FFmpeg::setup_general (bool long_probe) av_dict_set (&options, "probesize", lexical_cast (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;