Skip to content

Commit f235cc2

Browse files
committed
Revert some stuff
1 parent 1c4b1f9 commit f235cc2

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

.github/workflows/macos_wheel.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ jobs:
6363
fail-fast: false
6464
matrix:
6565
python-version: ['3.9']
66-
# TODO
67-
# ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
68-
ffmpeg-version-for-tests: ['5.1.2', '6.1.1', '7.0.1']
66+
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
6967
needs: build
7068
steps:
7169
- name: Download wheel

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,15 +573,13 @@ void VideoDecoder::addAudioStream(int streamIndex) {
573573

574574
VideoDecoder::FrameOutput VideoDecoder::getNextFrame() {
575575
auto output = getNextFrameInternal();
576-
if (streamInfos_[activeStreamIndex_].avMediaType == AVMEDIA_TYPE_VIDEO) {
577-
output.data = maybePermuteHWC2CHW(output.data);
578-
}
576+
output.data = maybePermuteHWC2CHW(output.data);
579577
return output;
580578
}
581579

582580
VideoDecoder::FrameOutput VideoDecoder::getNextFrameInternal(
583581
std::optional<torch::Tensor> preAllocatedOutputTensor) {
584-
validateActiveStream();
582+
validateActiveStream(AVMEDIA_TYPE_VIDEO);
585583
AVFrameStream avFrameStream = decodeAVFrame(
586584
[this](AVFrame* avFrame) { return avFrame->pts >= cursor_; });
587585
return convertAVFrameToFrameOutput(avFrameStream, preAllocatedOutputTensor);

test/decoders/test_ops.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ class TestAudioOps:
626626
partial(get_frames_in_range, start=4, stop=5),
627627
partial(get_frame_at_pts, seconds=2),
628628
partial(get_frames_by_pts, timestamps=[0, 1.5]),
629+
partial(get_next_frame),
629630
),
630631
)
631632
def test_audio_bad_method(self, method):

0 commit comments

Comments
 (0)