aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alffmpeg.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-10-03 00:29:08 -0700
committerChris Robinson <[email protected]>2012-10-03 00:29:08 -0700
commitdca6254b35bb1dc06e42fdf08443a9683e716058 (patch)
tree917dc5d3714e73996e4d7375f3d5f35573539178 /examples/alffmpeg.c
parentcccec40e87b302e8380c78153eeca85c99d40ece (diff)
Update some ffmpeg functions
Diffstat (limited to 'examples/alffmpeg.c')
-rw-r--r--examples/alffmpeg.c12
1 files changed, 5 insertions, 7 deletions
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;