Skip to content

Commit 647b4ab

Browse files
authored
Ensure switch statement returns. (#1001)
To suppress compiler errors.
1 parent a7f83c4 commit 647b4ab

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/libspdl/core/muxer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ std::string to_str(MediaType media) {
6363
return "video";
6464
case MediaType::Image:
6565
return "image";
66+
default:
67+
throw std::domain_error("[INTERNAL ERROR] Unexpected media type.");
6668
}
6769
}
6870
} // namespace

src/libspdl/cuda/nvdec/detail/utils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ cudaVideoCodec convert_codec_id(spdl::core::CodecID id) {
4545
return cudaVideoCodec_JPEG;
4646
case spdl::core::CodecID::AV1:
4747
return cudaVideoCodec_AV1;
48+
default:
49+
throw std::domain_error("[INTERNAL ERROR] Unexpected value is provided.");
4850
}
4951
}
5052

0 commit comments

Comments
 (0)