diff options
author | Chris Robinson <[email protected]> | 2012-10-03 00:29:08 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-10-03 00:29:08 -0700 |
commit | dca6254b35bb1dc06e42fdf08443a9683e716058 (patch) | |
tree | 917dc5d3714e73996e4d7375f3d5f35573539178 | |
parent | cccec40e87b302e8380c78153eeca85c99d40ece (diff) |
Update some ffmpeg functions
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/alffmpeg.c | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 04d1e8fb..f8ba10e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -724,7 +724,7 @@ SET(BACKENDS "${BACKENDS} Null") IF(EXAMPLES) # Might be able to use earlier versions, but these definitely work - PKG_CHECK_MODULES(FFMPEG libavcodec>=52.123.0 libavformat>=52.111.0 libavutil>=51.9.1) + PKG_CHECK_MODULES(FFMPEG libavcodec>=53.61.100 libavformat>=53.32.100 libavutil>=51.35.100) ENDIF() IF(LIBTYPE STREQUAL "STATIC") diff --git a/examples/alffmpeg.c b/examples/alffmpeg.c index 98c9c15b..786d78c3 100644 --- a/examples/alffmpeg.c +++ b/examples/alffmpeg.c @@ -173,7 +173,7 @@ FilePtr openAVFile(const char *fname) * all formats will have it in stream headers */ if(avformat_find_stream_info(file->FmtCtx, NULL) >= 0) return file; - av_close_input_file(file->FmtCtx); + avformat_close_input(&file->FmtCtx); } free(file); @@ -205,8 +205,7 @@ FilePtr openAVData(const char *name, char *buffer, size_t buffer_len) { if(avformat_find_stream_info(file->FmtCtx, NULL) >= 0) return file; - av_close_input_file(file->FmtCtx); - file->FmtCtx = NULL; + avformat_close_input(&file->FmtCtx); } if(file->FmtCtx) avformat_free_context(file->FmtCtx); @@ -240,8 +239,7 @@ FilePtr openAVCustom(const char *name, void *user_data, { if(avformat_find_stream_info(file->FmtCtx, NULL) >= 0) return file; - av_close_input_file(file->FmtCtx); - file->FmtCtx = NULL; + avformat_close_input(&file->FmtCtx); } if(file->FmtCtx) avformat_free_context(file->FmtCtx); @@ -280,7 +278,7 @@ void closeAVFile(FilePtr file) } free(file->Streams); - av_close_input_file(file->FmtCtx); + avformat_close_input(&file->FmtCtx); free(file); } @@ -335,7 +333,7 @@ StreamPtr getAVAudioStream(FilePtr file, int streamnum) /* Try to find the codec for the given codec ID, and open it */ codec = avcodec_find_decoder(stream->CodecCtx->codec_id); - if(!codec || avcodec_open(stream->CodecCtx, codec) < 0) + if(!codec || avcodec_open2(stream->CodecCtx, codec, NULL) < 0) { free(stream); return NULL; |