mirror of https://github.com/mpv-player/mpv
Error out when invalid format is specified
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15312 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
fcb57df513
commit
b7f3811b29
|
@ -139,6 +139,10 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
|||
}
|
||||
case AF_CONTROL_COMMAND_LINE:{
|
||||
int format = af_str2fmt_short(arg);
|
||||
if (format == -1) {
|
||||
af_msg(AF_MSG_ERROR, "[format] %s is not a valid format\n", (char *)arg);
|
||||
return AF_ERROR;
|
||||
}
|
||||
if(AF_OK != af->control(af,AF_CONTROL_FORMAT_FMT | AF_CONTROL_SET,&format))
|
||||
return AF_ERROR;
|
||||
return AF_OK;
|
||||
|
|
Loading…
Reference in New Issue