Skip to content

Commit 6383bca

Browse files
committed
Fix stuff
1 parent 5112494 commit 6383bca

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/torchcodec/decoders/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@
77
from ._core import VideoStreamMetadata
88
from ._video_decoder import VideoDecoder # noqa
99

10-
# from ._audio_decoder import AudioDecoder # Will be public when more stable
11-
1210
SimpleVideoDecoder = VideoDecoder

src/torchcodec/decoders/_core/FFMPEGCommon.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ int getNumChannels(const AVFrame* avFrame) {
7070
}
7171

7272
int getNumChannels(const UniqueAVCodecContext& avCodecContext) {
73-
// Not sure about the exactness of the version bounds, but as long as this
74-
// compile we're fine.
7573
#if LIBAVFILTER_VERSION_MAJOR > 8 || \
7674
(IBAVFILTER_VERSION_MAJOR == 8 && LIBAVFILTER_VERSION_MINOR >= 44)
7775
return avCodecContext->ch_layout.nb_channels;

src/torchcodec/decoders/_core/_metadata.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
)
2020

2121

22-
# TODO-audio: docs below are mostly for video streams.
22+
# TODO-audio: docs below are mostly for video streams, we should edit them and /
23+
# or make sure they're OK for audio streams as well. Not sure how to best handle
24+
# docs for such class hierarchy.
2325
@dataclass
2426
class StreamMetadata:
2527
duration_seconds_from_header: Optional[float]
@@ -154,6 +156,8 @@ def __repr__(self):
154156

155157
@dataclass
156158
class AudioStreamMetadata(StreamMetadata):
159+
"""Metadata of a single audio stream."""
160+
157161
# TODO-AUDIO do we expose the notion of frame here, like in fps? It's technically
158162
# valid, but potentially is an FFmpeg-specific concept for audio
159163
# TODO-AUDIO Need sample rate and format and num_channels

test/decoders/test_video_decoder_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def test_audio_get_json_metadata(self):
400400
decoder = create_from_file(str(NASA_AUDIO.path))
401401
metadata = get_json_metadata(decoder)
402402
metadata_dict = json.loads(metadata)
403-
assert metadata_dict["durationSeconds"] == pytest.approx(13.013, abs=0.01)
403+
assert metadata_dict["durationSeconds"] == pytest.approx(13.248, abs=0.01)
404404

405405
def test_get_ffmpeg_version(self):
406406
ffmpeg_dict = get_ffmpeg_library_versions()

0 commit comments

Comments
 (0)