*intervals = NULL;
*nb_intervals = 0;
+ if (!buf)
+ return 0;
+
while (1) {
Interval interval;
SendCmdContext *sendcmd = ctx->priv;
int ret, i, j;
- if (sendcmd->commands_filename && sendcmd->commands_str) {
+ if ((!!sendcmd->commands_filename + !!sendcmd->commands_str) != 1) {
av_log(ctx, AV_LOG_ERROR,
- "Only one of the filename or commands options must be specified\n");
+ "One and only one of the filename or commands options must be specified\n");
return AVERROR(EINVAL);
}
return ret;
if (sendcmd->nb_intervals == 0) {
- av_log(ctx, AV_LOG_ERROR, "No commands\n");
+ av_log(ctx, AV_LOG_ERROR, "No commands were specified\n");
return AVERROR(EINVAL);
}