Justin Ruggles <[email protected]> writes: > --- > libavformat/seek-test.c | 15 ++++++++++----- > 1 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/libavformat/seek-test.c b/libavformat/seek-test.c > index 3dd60dc..d52ee16 100644 > --- a/libavformat/seek-test.c > +++ b/libavformat/seek-test.c > @@ -26,6 +26,7 @@ > > #include "libavutil/common.h" > #include "libavutil/mathematics.h" > +#include "libavutil/opt.h" > #include "libavformat/avformat.h" > > #undef exit > @@ -64,10 +65,7 @@ int main(int argc, char **argv) > AVFormatContext *ic = NULL; > int i, ret, stream_id; > int64_t timestamp; > - AVFormatParameters params, *ap= ¶ms; > - memset(ap, 0, sizeof(params)); > - ap->channels=1; > - ap->sample_rate= 22050; > + AVDictionary *opts = NULL; > > /* initialize libavcodec, and register all codecs and formats */ > av_register_all(); > @@ -80,7 +78,14 @@ int main(int argc, char **argv) > > filename = argv[1]; > > - ret = av_open_input_file(&ic, filename, NULL, 0, ap); > + if (av_dict_set(&opts, "channels", "1", 0) < 0 || > + av_dict_set(&opts, "sample_rate", "22050", 0) < 0) { > + av_dict_free(&opts); > + fprintf(stderr, "error setting demuxer options\n"); > + exit(1); > + } > + ret = avformat_open_input(&ic, filename, NULL, &opts); > + av_dict_free(&opts);
Why are these options being set at all? -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
