Permalink
Browse files

Merge pull request #1473 from TheCycoONE/movie_no_decoder

Handle when no supported video stream is found
  • Loading branch information...
Alberth289346 committed Sep 28, 2018
2 parents 309460a + 09c2085 commit 02896f9ab7a725dfec0f9b8f0fba8035f0df9636
Showing with 5 additions and 0 deletions.
  1. +5 −0 CorsixTH/Src/th_movie.cpp
@@ -462,6 +462,11 @@ bool movie_player::load(const char* szFilepath)
}
video_stream_index = av_find_best_stream(format_context, AVMEDIA_TYPE_VIDEO, -1, -1, &m_pVideoCodec, 0);
if (video_stream_index < 0) {
av_strerror(video_stream_index, error_buffer, movie_error_buffer_capacity);
last_error = std::string(error_buffer);
return false;
}
video_codec_context = get_codec_context_for_stream(m_pVideoCodec, format_context->streams[video_stream_index]);
avcodec_open2(video_codec_context, m_pVideoCodec, nullptr);

0 comments on commit 02896f9

Please sign in to comment.