# HG changeset patch # User michael # Date 1210447778 0 # Node ID 53b6cf6b971d1aaafcf99befb259d39724ce60af # Parent 1af41774481be252c4cf236ec30c2ba78c3d0d9d AVOption support for lavf demuxing diff -r 1af41774481b -r 53b6cf6b971d libmpdemux/demux_lavf.c --- a/libmpdemux/demux_lavf.c Sat May 10 19:22:41 2008 +0000 +++ b/libmpdemux/demux_lavf.c Sat May 10 19:29:38 2008 +0000 @@ -24,6 +24,7 @@ #include "config.h" #include "mp_msg.h" #include "help_mp.h" +#include "av_opts.h" #include "stream/stream.h" #include "demuxer.h" @@ -49,12 +50,14 @@ static char *opt_format; static char *opt_cryptokey; extern int ts_prog; +static char *opt_avopt = NULL; const m_option_t lavfdopts_conf[] = { {"probesize", &(opt_probesize), CONF_TYPE_INT, CONF_RANGE, 32, INT_MAX, NULL}, {"format", &(opt_format), CONF_TYPE_STRING, 0, 0, 0, NULL}, {"analyzeduration", &(opt_analyzeduration), CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL}, {"cryptokey", &(opt_cryptokey), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"o", &opt_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; @@ -435,6 +438,13 @@ if(!opt) mp_msg(MSGT_HEADER,MSGL_ERR, "demux_lavf, couldn't set option analyzeduration to %u\n", opt_analyzeduration); } + if(opt_avopt){ + if(parse_avopts(avfc, opt_avopt) < 0){ + mp_msg(MSGT_HEADER,MSGL_ERR, "Your options /%s/ look like gibberish to me pal\n", opt_avopt); + return NULL; + } + } + if(demuxer->stream->url) strncpy(mp_filename + 3, demuxer->stream->url, sizeof(mp_filename)-3); else