[FFmpeg-cvslog] avfilter/fifo: use the name 's' for the pointer to the private context

Paul B Mahol git at videolan.org
Sat Sep 28 23:11:09 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Sep 28 22:06:50 2019 +0200| [947e8ab329af5d59d47c1ef8a08d6a84109a89be] | committer: Paul B Mahol

avfilter/fifo: use the name 's' for the pointer to the private context

This is shorter and consistent across filters.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=947e8ab329af5d59d47c1ef8a08d6a84109a89be
---

 libavfilter/fifo.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
index 39204eb1c2..f5587df62a 100644
--- a/libavfilter/fifo.c
+++ b/libavfilter/fifo.c
@@ -53,38 +53,38 @@ typedef struct FifoContext {
 
 static av_cold int init(AVFilterContext *ctx)
 {
-    FifoContext *fifo = ctx->priv;
-    fifo->last = &fifo->root;
+    FifoContext *s = ctx->priv;
+    s->last = &s->root;
 
     return 0;
 }
 
 static av_cold void uninit(AVFilterContext *ctx)
 {
-    FifoContext *fifo = ctx->priv;
+    FifoContext *s = ctx->priv;
     Buf *buf, *tmp;
 
-    for (buf = fifo->root.next; buf; buf = tmp) {
+    for (buf = s->root.next; buf; buf = tmp) {
         tmp = buf->next;
         av_frame_free(&buf->frame);
         av_free(buf);
     }
 
-    av_frame_free(&fifo->out);
+    av_frame_free(&s->out);
 }
 
 static int add_to_queue(AVFilterLink *inlink, AVFrame *frame)
 {
-    FifoContext *fifo = inlink->dst->priv;
+    FifoContext *s = inlink->dst->priv;
 
-    fifo->last->next = av_mallocz(sizeof(Buf));
-    if (!fifo->last->next) {
+    s->last->next = av_mallocz(sizeof(Buf));
+    if (!s->last->next) {
         av_frame_free(&frame);
         return AVERROR(ENOMEM);
     }
 
-    fifo->last = fifo->last->next;
-    fifo->last->frame = frame;
+    s->last = s->last->next;
+    s->last->frame = frame;
 
     return 0;
 }
@@ -229,24 +229,24 @@ static int return_audio_frame(AVFilterContext *ctx)
 
 static int request_frame(AVFilterLink *outlink)
 {
-    FifoContext *fifo = outlink->src->priv;
+    FifoContext *s = outlink->src->priv;
     int ret = 0;
 
-    if (!fifo->root.next) {
+    if (!s->root.next) {
         if ((ret = ff_request_frame(outlink->src->inputs[0])) < 0) {
             if (ret == AVERROR_EOF && outlink->request_samples)
                 return return_audio_frame(outlink->src);
             return ret;
         }
-        if (!fifo->root.next)
+        if (!s->root.next)
             return 0;
     }
 
     if (outlink->request_samples) {
         return return_audio_frame(outlink->src);
     } else {
-        ret = ff_filter_frame(outlink, fifo->root.next->frame);
-        queue_pop(fifo);
+        ret = ff_filter_frame(outlink, s->root.next->frame);
+        queue_pop(s);
     }
 
     return ret;



More information about the ffmpeg-cvslog mailing list