summaryrefslogtreecommitdiffstats
path: root/libavfilter/f_sendcmd.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-09-09 14:30:35 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2015-09-15 13:21:57 -0400
commitf7b53c95277826dd36533474f5193e47c64b457b (patch)
treef0de0da7fe2f5fd9a31039a39fc36f977ac325ed /libavfilter/f_sendcmd.c
parentaaf4e703f6d9583e1a910191f39e738cf5595e24 (diff)
downloadffmpeg-streaming-f7b53c95277826dd36533474f5193e47c64b457b.zip
ffmpeg-streaming-f7b53c95277826dd36533474f5193e47c64b457b.tar.gz
avfilter/f_sendcmd: use the name 's' for the pointer to the private context
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavfilter/f_sendcmd.c')
-rw-r--r--libavfilter/f_sendcmd.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c
index 7cb958b..37aedc5 100644
--- a/libavfilter/f_sendcmd.c
+++ b/libavfilter/f_sendcmd.c
@@ -373,19 +373,19 @@ static int cmp_intervals(const void *a, const void *b)
static av_cold int init(AVFilterContext *ctx)
{
- SendCmdContext *sendcmd = ctx->priv;
+ SendCmdContext *s = ctx->priv;
int ret, i, j;
- if ((!!sendcmd->commands_filename + !!sendcmd->commands_str) != 1) {
+ if ((!!s->commands_filename + !!s->commands_str) != 1) {
av_log(ctx, AV_LOG_ERROR,
"One and only one of the filename or commands options must be specified\n");
return AVERROR(EINVAL);
}
- if (sendcmd->commands_filename) {
+ if (s->commands_filename) {
uint8_t *file_buf, *buf;
size_t file_bufsize;
- ret = av_file_map(sendcmd->commands_filename,
+ ret = av_file_map(s->commands_filename,
&file_buf, &file_bufsize, 0, ctx);
if (ret < 0)
return ret;
@@ -399,24 +399,24 @@ static av_cold int init(AVFilterContext *ctx)
memcpy(buf, file_buf, file_bufsize);
buf[file_bufsize] = 0;
av_file_unmap(file_buf, file_bufsize);
- sendcmd->commands_str = buf;
+ s->commands_str = buf;
}
- if ((ret = parse_intervals(&sendcmd->intervals, &sendcmd->nb_intervals,
- sendcmd->commands_str, ctx)) < 0)
+ if ((ret = parse_intervals(&s->intervals, &s->nb_intervals,
+ s->commands_str, ctx)) < 0)
return ret;
- if (sendcmd->nb_intervals == 0) {
+ if (s->nb_intervals == 0) {
av_log(ctx, AV_LOG_ERROR, "No commands were specified\n");
return AVERROR(EINVAL);
}
- qsort(sendcmd->intervals, sendcmd->nb_intervals, sizeof(Interval), cmp_intervals);
+ qsort(s->intervals, s->nb_intervals, sizeof(Interval), cmp_intervals);
av_log(ctx, AV_LOG_DEBUG, "Parsed commands:\n");
- for (i = 0; i < sendcmd->nb_intervals; i++) {
+ for (i = 0; i < s->nb_intervals; i++) {
AVBPrint pbuf;
- Interval *interval = &sendcmd->intervals[i];
+ Interval *interval = &s->intervals[i];
av_log(ctx, AV_LOG_VERBOSE, "start_time:%f end_time:%f index:%d\n",
(double)interval->start_ts/1000000, (double)interval->end_ts/1000000, interval->index);
for (j = 0; j < interval->nb_commands; j++) {
@@ -432,11 +432,11 @@ static av_cold int init(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
{
- SendCmdContext *sendcmd = ctx->priv;
+ SendCmdContext *s = ctx->priv;
int i, j;
- for (i = 0; i < sendcmd->nb_intervals; i++) {
- Interval *interval = &sendcmd->intervals[i];
+ for (i = 0; i < s->nb_intervals; i++) {
+ Interval *interval = &s->intervals[i];
for (j = 0; j < interval->nb_commands; j++) {
Command *cmd = &interval->commands[j];
av_freep(&cmd->target);
@@ -445,13 +445,13 @@ static av_cold void uninit(AVFilterContext *ctx)
}
av_freep(&interval->commands);
}
- av_freep(&sendcmd->intervals);
+ av_freep(&s->intervals);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *ref)
{
AVFilterContext *ctx = inlink->dst;
- SendCmdContext *sendcmd = ctx->priv;
+ SendCmdContext *s = ctx->priv;
int64_t ts;
int i, j, ret;
@@ -462,8 +462,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *ref)
#define WITHIN_INTERVAL(ts, start_ts, end_ts) ((ts) >= (start_ts) && (ts) < (end_ts))
- for (i = 0; i < sendcmd->nb_intervals; i++) {
- Interval *interval = &sendcmd->intervals[i];
+ for (i = 0; i < s->nb_intervals; i++) {
+ Interval *interval = &s->intervals[i];
int flags = 0;
if (!interval->enabled && WITHIN_INTERVAL(ts, interval->start_ts, interval->end_ts)) {
OpenPOWER on IntegriCloud