mirror of https://github.com/mpv-player/mpv
AVOptions support.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26723 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
13b723459b
commit
57a3542801
3
Makefile
3
Makefile
|
@ -261,7 +261,8 @@ SRCS_COMMON-$(LIBASS) += libass/ass.c \
|
|||
libass/ass_utils.c \
|
||||
libmpcodecs/vf_ass.c \
|
||||
|
||||
SRCS_COMMON-$(LIBAVCODEC) += libaf/af_lavcresample.c \
|
||||
SRCS_COMMON-$(LIBAVCODEC) += av_opts.c \
|
||||
libaf/af_lavcresample.c \
|
||||
libmpcodecs/ad_ffmpeg.c \
|
||||
libmpcodecs/vd_ffmpeg.c \
|
||||
libmpcodecs/vf_lavc.c \
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "libavcodec/opt.h"
|
||||
|
||||
int parse_avopts(void *v, char *str){
|
||||
char *start;
|
||||
start= str= strdup(str);
|
||||
|
||||
while(str && *str){
|
||||
char *next_opt, *arg;
|
||||
|
||||
next_opt= strchr(str, ',');
|
||||
if(next_opt) *next_opt++= 0;
|
||||
|
||||
arg = strchr(str, '=');
|
||||
if(arg) *arg++= 0;
|
||||
|
||||
if(!av_set_string(v, str, arg)){
|
||||
free(start);
|
||||
return -1;
|
||||
}
|
||||
str= next_opt;
|
||||
}
|
||||
|
||||
free(start);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue