1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-17 04:15:13 +00:00

AVOption support for lavf demuxing

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26728 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2008-05-10 19:29:38 +00:00
parent 2ce3df53b1
commit 5f4cface7b

View File

@ -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 unsigned int opt_analyzeduration = 0;
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 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
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