@@ -803,7 +803,7 @@ void VideoDecoder::maybeSeekToBeforeDesiredPts() {
803803 }
804804}
805805
806- VideoDecoder::AVFrameStream VideoDecoder::getAVFrameUsingFilterFunction (
806+ VideoDecoder::AVFrameStream VideoDecoder::filteredDecode (
807807 std::function<bool (int , AVFrame*)> filter) {
808808 if (activeStreamIndices_.size () == 0 ) {
809809 throw std::runtime_error (" No active streams configured." );
@@ -1103,8 +1103,8 @@ VideoDecoder::FrameOutput VideoDecoder::getFramePlayedAtNoDemux(
11031103 }
11041104
11051105 setCursorPtsInSeconds (seconds);
1106- AVFrameStream avFrameStream = getAVFrameUsingFilterFunction (
1107- [seconds, this ](int frameStreamIndex, AVFrame* avFrame) {
1106+ AVFrameStream avFrameStream =
1107+ filteredDecode ( [seconds, this ](int frameStreamIndex, AVFrame* avFrame) {
11081108 StreamInfo& streamInfo = streamInfos_[frameStreamIndex];
11091109 double frameStartTime = ptsToSeconds (avFrame->pts , streamInfo.timeBase );
11101110 double frameEndTime = ptsToSeconds (
@@ -1504,8 +1504,8 @@ VideoDecoder::FrameOutput VideoDecoder::getNextFrameNoDemux() {
15041504
15051505VideoDecoder::FrameOutput VideoDecoder::getNextFrameNoDemuxInternal (
15061506 std::optional<torch::Tensor> preAllocatedOutputTensor) {
1507- AVFrameStream avFrameStream = getAVFrameUsingFilterFunction (
1508- [this ](int frameStreamIndex, AVFrame* avFrame) {
1507+ AVFrameStream avFrameStream =
1508+ filteredDecode ( [this ](int frameStreamIndex, AVFrame* avFrame) {
15091509 StreamInfo& activeStreamInfo = streamInfos_[frameStreamIndex];
15101510 return avFrame->pts >= activeStreamInfo.discardFramesBeforePts ;
15111511 });
0 commit comments