Skip to content

Commit 609423d

Browse files
committed
Revert "Comments"
This reverts commit c39e054.
1 parent cfb97e5 commit 609423d

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/torchcodec/decoders/_blocks/_demuxer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ def scan(self) -> StreamIndex:
261261
)
262262

263263

264+
# TODO_API_BREAKDOWN FEAT P1 no scan() here: StreamIndex is video-shaped
265+
# (keyframes, frame indices, fps), and audio has none of those notions. What an
266+
# audio scan should return - exact duration, total sample count - is part of the
267+
# StreamIndex redesign above.
264268
class AudioDemuxer(_BaseDemuxer):
265269
"""Demux building block: opens a container and yields the compressed
266270
:class:`Packet`\\ s for one audio stream. Does no decoding.

test/test_decoders.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5051,7 +5051,9 @@ def test_audio_demuxer_source_kinds(self, make_source):
50515051
assert len(list(AudioDemuxer(make_source(NASA_AUDIO_MP3.path)))) == expected
50525052

50535053
def test_audio_demuxer_seek(self):
5054-
# Seeking past the start leaves fewer packets to demux.
5054+
# Seeking past the start leaves fewer packets to demux. We don't assert
5055+
# anything about *which* ones: audio has no keyframe to land on, so
5056+
# where a seek lands is the demuxer's business, not something we pin.
50555057
num_packets_from_start = len(list(AudioDemuxer(NASA_AUDIO_MP3.path)))
50565058

50575059
demuxer = AudioDemuxer(NASA_AUDIO_MP3.path)
@@ -5060,6 +5062,10 @@ def test_audio_demuxer_seek(self):
50605062

50615063
assert 0 < num_packets_after_seek < num_packets_from_start
50625064

5065+
def test_audio_demuxer_has_no_scan(self):
5066+
# See the TODO in _demuxer.py: StreamIndex is video-shaped.
5067+
assert not hasattr(AudioDemuxer(NASA_AUDIO_MP3.path), "scan")
5068+
50635069
# ===== Audio decoding: RawAudioSamples =====
50645070

50655071
@staticmethod

0 commit comments

Comments
 (0)