Mercurial > mplayer.hg
changeset 26696:53b6cf6b971d
AVOption support for lavf demuxing
author | michael |
---|---|
date | Sat, 10 May 2008 19:29:38 +0000 |
parents | 1af41774481b |
children | baaeace9c6a8 |
files | libmpdemux/demux_lavf.c |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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