Skip to content
Snippets Groups Projects
Commit c2aa6d97 authored by Tom Greig's avatar Tom Greig
Browse files

Support newer version of libavformat

In later version, av_find_best_stream fills in a pointer to *const*
AVCodec* and I need a preprocessor check to make sure I can handle both
the new version and the old one void gives me. (To be fair, it should
have been a const all along, so I'm not annoyed at the change.)
parent 9aa8d93a
No related branches found
No related tags found
No related merge requests found
...@@ -400,7 +400,11 @@ static int open_video( struct input_source* source, char** error ) { ...@@ -400,7 +400,11 @@ static int open_video( struct input_source* source, char** error ) {
return -1; return -1;
} }
#if LIBAVFORMAT_VERSION_MAJOR >= 59
const AVCodec* decoder;
#else
AVCodec* decoder; AVCodec* decoder;
#endif
int stream_number = av_find_best_stream( format_context, int stream_number = av_find_best_stream( format_context,
AVMEDIA_TYPE_VIDEO, -1, -1, &decoder, 0 ); AVMEDIA_TYPE_VIDEO, -1, -1, &decoder, 0 );
if ( 0 > stream_number ) { if ( 0 > stream_number ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment