Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Minor fixes in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmtroffaes committed Oct 8, 2020
1 parent 19b5539 commit cbc7582
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
14 changes: 1 addition & 13 deletions test/avcodec/list_all_codecs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,14 @@ extern "C" {
#include <libavcodec/avcodec.h>
}

auto media_type_str(AVMediaType t) {
switch (t) {
case AVMEDIA_TYPE_UNKNOWN: return "unknown";
case AVMEDIA_TYPE_VIDEO: return "video";
case AVMEDIA_TYPE_AUDIO: return "audio";
case AVMEDIA_TYPE_DATA: return "data";
case AVMEDIA_TYPE_SUBTITLE: return "subtitle";
case AVMEDIA_TYPE_ATTACHMENT: return "attachment";
default: return "invalid";
}
}

int main()
{
AVCodec* p = nullptr;
void* i = nullptr;
while ((p = (AVCodec*)av_codec_iterate(&i))) {
std::cout
<< "name: " << p->name << std::endl
<< "type: " << media_type_str(p->type) << std::endl
<< "type: " << av_get_media_type_string(p->type) << std::endl
<< "encoder: " << av_codec_is_encoder(p) << std::endl
<< "decoder: " << av_codec_is_decoder(p) << std::endl
<< std::endl;
Expand Down
2 changes: 1 addition & 1 deletion test/avformat/decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct Stream {
logger::debug() << "frame sample format: " << av_get_sample_fmt_name((AVSampleFormat)frame->format);
}
else {
logger::error() << "cannot handle codec type " << context->codec->type;
logger::error() << "cannot handle codec type " << av_get_media_type_string(context->codec->type);
return -1;
}
av_frame_unref(frame.get());
Expand Down
2 changes: 1 addition & 1 deletion test/avutil/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extern "C" {
int main()
{
logger::info() << av_version_info();
logger::info() << "avutil version" << avutil_version();
logger::info() << "avutil version " << avutil_version();
logger::info() << avutil_configuration();
logger::info() << avutil_license();
return 0;
Expand Down

0 comments on commit cbc7582

Please sign in to comment.