]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/seek-test.c
bethsoftvid: pass palette in side data instead of in a separate packet.
[ffmpeg] / libavformat / seek-test.c
index 3dd60dc1608ac6ccf62e6b74491b1038386924dc..699c693c3fbdc9450ea66924d310e5db1785005e 100644 (file)
@@ -28,7 +28,6 @@
 #include "libavutil/mathematics.h"
 #include "libavformat/avformat.h"
 
-#undef exit
 #undef printf
 #undef fprintf
 
@@ -64,10 +63,10 @@ int main(int argc, char **argv)
     AVFormatContext *ic = NULL;
     int i, ret, stream_id;
     int64_t timestamp;
-    AVFormatParameters params, *ap= &params;
-    memset(ap, 0, sizeof(params));
-    ap->channels=1;
-    ap->sample_rate= 22050;
+    AVDictionary *format_opts = NULL;
+
+    av_dict_set(&format_opts, "channels", "1", 0);
+    av_dict_set(&format_opts, "sample_rate", "22050", 0);
 
     /* initialize libavcodec, and register all codecs and formats */
     av_register_all();
@@ -75,21 +74,22 @@ int main(int argc, char **argv)
     if (argc != 2) {
         printf("usage: %s input_file\n"
                "\n", argv[0]);
-        exit(1);
+        return 1;
     }
 
     filename = argv[1];
 
-    ret = av_open_input_file(&ic, filename, NULL, 0, ap);
+    ret = avformat_open_input(&ic, filename, NULL, &format_opts);
+    av_dict_free(&format_opts);
     if (ret < 0) {
         fprintf(stderr, "cannot open %s\n", filename);
-        exit(1);
+        return 1;
     }
 
     ret = avformat_find_stream_info(ic, NULL);
     if (ret < 0) {
         fprintf(stderr, "%s: could not find codec parameters\n", filename);
-        exit(1);
+        return 1;
     }
 
     for(i=0; ; i++){
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
         printf("ret:%-10s st:%2d flags:%d  ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf);
     }
 
-    av_close_input_file(ic);
+    avformat_close_input(&ic);
 
     return 0;
 }