File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
src/torchcodec/decoders/_core Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -1472,15 +1472,6 @@ VideoDecoder::FrameBatchOutput VideoDecoder::getFramesPlayedInRange(
14721472 return frameBatchOutput;
14731473}
14741474
1475- VideoDecoder::AVFrameStream VideoDecoder::getNextAVFrameNoDemux () {
1476- auto avFrameStream = getAVFrameUsingFilterFunction (
1477- [this ](int frameStreamIndex, AVFrame* avFrame) {
1478- StreamInfo& activeStreamInfo = streamInfos_[frameStreamIndex];
1479- return avFrame->pts >= activeStreamInfo.discardFramesBeforePts ;
1480- });
1481- return avFrameStream;
1482- }
1483-
14841475VideoDecoder::FrameOutput VideoDecoder::getNextFrameNoDemux () {
14851476 auto output = getNextFrameNoDemuxInternal ();
14861477 output.data = maybePermuteHWC2CHW (output.streamIndex , output.data );
@@ -1489,7 +1480,11 @@ VideoDecoder::FrameOutput VideoDecoder::getNextFrameNoDemux() {
14891480
14901481VideoDecoder::FrameOutput VideoDecoder::getNextFrameNoDemuxInternal (
14911482 std::optional<torch::Tensor> preAllocatedOutputTensor) {
1492- auto avFrameStream = getNextAVFrameNoDemux ();
1483+ AVFrameStream avFrameStream = getAVFrameUsingFilterFunction (
1484+ [this ](int frameStreamIndex, AVFrame* avFrame) {
1485+ StreamInfo& activeStreamInfo = streamInfos_[frameStreamIndex];
1486+ return avFrame->pts >= activeStreamInfo.discardFramesBeforePts ;
1487+ });
14931488 return convertAVFrameToFrameOutput (avFrameStream, preAllocatedOutputTensor);
14941489}
14951490
Original file line number Diff line number Diff line change @@ -403,7 +403,6 @@ class VideoDecoder {
403403 void maybeSeekToBeforeDesiredPts ();
404404 AVFrameStream getAVFrameUsingFilterFunction (
405405 std::function<bool (int , AVFrame*)>);
406- AVFrameStream getNextAVFrameNoDemux ();
407406 // Once we create a decoder can update the metadata with the codec context.
408407 // For example, for video streams, we can add the height and width of the
409408 // decoded stream.
You can’t perform that action at this time.
0 commit comments