Skip to content

Commit f1a0ec5

Browse files
committed
Revert "Comments"
This reverts commit c39e054.
1 parent 21a5e7c commit f1a0ec5

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
@@ -5050,7 +5050,9 @@ def test_audio_demuxer_source_kinds(self, make_source):
50505050
assert len(list(AudioDemuxer(make_source(NASA_AUDIO_MP3.path)))) == expected
50515051

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

50565058
demuxer = AudioDemuxer(NASA_AUDIO_MP3.path)
@@ -5059,6 +5061,10 @@ def test_audio_demuxer_seek(self):
50595061

50605062
assert 0 < num_packets_after_seek < num_packets_from_start
50615063

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

50645070
@staticmethod

0 commit comments

Comments
 (0)