makulix 发表于 2005-12-6 21:32

在c程序中如何启动mplayer(unter Linux)?

我想在c程序中启动mplayer(unter Linux),但是不知道使用什么函数。在正常的shell里我呼叫的命令是
"mplayer /home/da/pepsi.mpg",我是想在c程序中启动它。

谢谢先

tecehux 发表于 2005-12-6 21:36

NAME
       system - execute a shell command

SYNOPSIS
       #include <stdlib.h>

       int system(const char *command);

DESCRIPTION
       system()executesacommand specified in command by calling /bin/sh -c command, and returns after the command has been completed.
       During execution of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored.

makulix 发表于 2005-12-6 21:43

请问,在具体情况下应该在command里写什么?

tecehux 发表于 2005-12-7 19:34

int ret=system("mplayer /home/da/pepsi.mpg");

自己看一下man system吧
页: [1]
查看完整版本: 在c程序中如何启动mplayer(unter Linux)?