Fix build of vainfo. 19/419/1
authorGwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Thu, 2 Jul 2009 09:15:58 +0000 (09:15 +0000)
committerAustin Yuan <shengquan.yuan@intel.com>
Wed, 8 Jul 2009 06:19:00 +0000 (14:19 +0800)
commit f8aebf54e0d6b2411cb495f9fab71dc8a05c245c
Author: Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Date:   Thu Jun 25 14:06:38 2009 +0000

    Further fixes to vainfo: use strrchr() instead of rindex(), make
    profile_string() and entrypoint_string() always return a value.

commit 4e6d19d5588998b5a9da30500ce727410b5787ef
Author: Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Date:   Wed Jun 24 12:43:55 2009 +0000

    Fix vainfo error messages.

Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
test/Makefile.am
test/vainfo.c

index 37b3f06..6554962 100644 (file)
@@ -23,7 +23,7 @@
 check_PROGRAMS = test_01 test_02 test_03 test_04 test_05 test_06 \
                test_07 test_08 test_09 test_10 test_11 test_12
 
-bin_PROGRAMS = 
+bin_PROGRAMS = vainfo
 
 testdir = $(bindir)
 
index a886815..ed05881 100644 (file)
@@ -22,7 +22,7 @@
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <X11/va_x11.h>
+#include <va_x11.h>
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -32,7 +32,7 @@
 
 #define CHECK_VASTATUS(va_status,func, ret)                             \
 if (va_status != VA_STATUS_SUCCESS) {                                   \
-    fprintf(stderr,"%s failed with error code %d (%s),exit\n",func, vaErrorStr(va_status)); \
+    fprintf(stderr,"%s failed with error code %d (%s),exit\n",func, va_status, vaErrorStr(va_status)); \
     exit(ret);                                                          \
 }
 
@@ -52,6 +52,7 @@ static char * profile_string(VAProfile profile)
             case VAProfileVC1Advanced: return "VAProfileVC1Advanced";
             case VAProfileH263Baseline: return "VAProfileH263Baseline";
     }
+    return "<unknown profile>";
 }
 
 
@@ -65,6 +66,7 @@ static char * entrypoint_string(VAEntrypoint entrypoint)
             case VAEntrypointDeblocking:return "VAEntrypointDeblocking";
             case VAEntrypointEncSlice:return "VAEntrypointEncSlice";
     }
+    return "<unknown entrypoint>";
 }
 
 int main(int argc, const char* argv[])
@@ -75,7 +77,7 @@ int main(int argc, const char* argv[])
   int major_version, minor_version;
   const char *driver;
   const char *display = getenv("DISPLAY");
-  const char *name = rindex(argv[0], '/'); 
+  const char *name = strrchr(argv[0], '/'); 
   VAProfile profile;
   VAEntrypoint entrypoint, entrypoints[10];
   int num_entrypoint;