0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

AVOptions support.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26723 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2008-05-10 18:54:10 +00:00
parent 13b723459b
commit 57a3542801
3 changed files with 34 additions and 1 deletions

View File

@ -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 \

27
av_opts.c Normal file
View File

@ -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;
}

5
av_opts.h Normal file
View File

@ -0,0 +1,5 @@
/**
* Parses str and sets AVOptions in v accordingly.
*/
int parse_avopts(void *v, char *str);