[MPlayer-cvslog] r26723 - in trunk: Makefile av_opts.c av_opts.h

michael subversion at mplayerhq.hu
Sat May 10 20:54:11 CEST 2008


Author: michael
Date: Sat May 10 20:54:10 2008
New Revision: 26723

Log:
AVOptions support.


Added:
   trunk/av_opts.c
   trunk/av_opts.h
Modified:
   trunk/Makefile

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Sat May 10 20:54:10 2008
@@ -261,7 +261,8 @@ SRCS_COMMON-$(LIBASS)                += 
                                         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 \

Added: trunk/av_opts.c
==============================================================================
--- (empty file)
+++ trunk/av_opts.c	Sat May 10 20:54:10 2008
@@ -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;
+}
\ No newline at end of file

Added: trunk/av_opts.h
==============================================================================
--- (empty file)
+++ trunk/av_opts.h	Sat May 10 20:54:10 2008
@@ -0,0 +1,5 @@
+
+/**
+ * Parses str and sets AVOptions in v accordingly.
+ */
+int parse_avopts(void *v, char *str);
\ No newline at end of file



More information about the MPlayer-cvslog mailing list