44// This source code is licensed under the BSD-style license found in the
55// LICENSE file in the root directory of this source tree.
66
7+ #include < pybind11/stl.h>
78#include < cstdint>
89#include < string>
9- #include < pybind11/stl.h>
1010
1111#include " src/torchcodec/decoders/_core/VideoDecoder.h"
1212
@@ -29,11 +29,14 @@ struct PyObjectDeleter {
2929class AVIOFileLikeContext : public AVIOContextHolder {
3030 public:
3131 AVIOFileLikeContext (py::object fileLike, int bufferSize)
32- : fileLikeContext_{std::unique_ptr<py::object, PyObjectDeleter>(new py::object (fileLike)), bufferSize} {
32+ : fileLikeContext_{
33+ std::unique_ptr<py::object, PyObjectDeleter>(
34+ new py::object (fileLike)),
35+ bufferSize} {
3336 {
34- // TODO: Is it necessary to acquire the GIL here? Is it maybe even harmful? At
35- // the moment, this is only called from within a pybind function, and pybind
36- // guarantees we have the GIL.
37+ // TODO: Is it necessary to acquire the GIL here? Is it maybe even
38+ // harmful? At the moment, this is only called from within a pybind
39+ // function, and pybind guarantees we have the GIL.
3740 py::gil_scoped_acquire gil;
3841 TORCH_CHECK (
3942 py::hasattr (fileLike, " read" ),
@@ -132,8 +135,8 @@ class AVIOFileLikeContext : public AVIOContextHolder {
132135
133136} // namespace
134137
135- // In principle, this should be able to return a tensor. But when we try that, we
136- // run into the bug reported here:
138+ // In principle, this should be able to return a tensor. But when we try that,
139+ // we run into the bug reported here:
137140//
138141// https://github.com/pytorch/pytorch/issues/136664
139142//
0 commit comments