util/demux: update use of deprecated API
authorDenys Dmytriyenko <denys@ti.com>
Fri, 11 Sep 2015 16:57:56 +0000 (12:57 -0400)
committerKarthik Ramanan <a0393906@ti.com>
Tue, 17 May 2016 10:50:20 +0000 (16:20 +0530)
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
util/demux.c

index d739519eab2bbe11d76b9494d5a642762848f47a..e932ac4e2364df41ae4ecf89c84ba110ab0fdf28 100644 (file)
@@ -44,18 +44,18 @@ int get_esds_offset(const char *filename, struct demux *demux);
 static AVFormatContext *
 open_file(const char *filename)
 {
-       AVFormatContext *afc;
-       int err = av_open_input_file(&afc, filename, NULL, 0, NULL);
+       static AVFormatContext *afc = NULL;
+       int err = avformat_open_input(&afc, filename, NULL, NULL);
 
        if (!err)
-               err = av_find_stream_info(afc);
+               err = avformat_find_stream_info(afc, NULL);
 
        if (err < 0) {
                ERROR("%s: lavf error %d", filename, err);
                exit(1);
        }
 
-       dump_format(afc, 0, filename, 0);
+       av_dump_format(afc, 0, filename, 0);
 
        return afc;
 }