X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_image_proxy.cc;h=db6059266dc472e13b8908a67f5baf0b2a800618;hb=8dabe7c3d815ff95c2fb3edc3cfce62434711fc4;hp=fa6cb288d28637ece3f55921cf69edb19fe1065e;hpb=fdc416faa317106d05be8fe5226ded84d8347d99;p=dcpomatic.git diff --git a/src/lib/ffmpeg_image_proxy.cc b/src/lib/ffmpeg_image_proxy.cc index fa6cb288d..db6059266 100644 --- a/src/lib/ffmpeg_image_proxy.cc +++ b/src/lib/ffmpeg_image_proxy.cc @@ -112,13 +112,14 @@ FFmpegImageProxy::avio_seek (int64_t const pos, int whence) return _pos; } -pair, int> + +ImageProxy::Result FFmpegImageProxy::image (optional) const { boost::mutex::scoped_lock lm (_mutex); if (_image) { - return make_pair (_image, 0); + return Result (_image, 0); } uint8_t* avio_buffer = static_cast (wrapped_av_malloc(4096)); @@ -147,7 +148,7 @@ FFmpegImageProxy::image (optional) const } if (e < 0) { if (_path) { - throw OpenFileError (_path->string(), e, true); + throw OpenFileError (_path->string(), e, OpenFileError::READ); } else { boost::throw_exception(DecodeError(String::compose(_("Could not decode image (%1)"), e))); } @@ -192,7 +193,7 @@ FFmpegImageProxy::image (optional) const av_free (avio_context->buffer); av_free (avio_context); - return make_pair (_image, 0); + return Result (_image, 0); } void @@ -202,7 +203,7 @@ FFmpegImageProxy::add_metadata (xmlpp::Node* node) const } void -FFmpegImageProxy::send_binary (shared_ptr socket) const +FFmpegImageProxy::write_to_socket (shared_ptr socket) const { socket->write (_data.size()); socket->write (_data.data().get(), _data.size());