[FFmpeg-devel] [PATCH] lavc/utils: rename ff_init_buffer_info() pic parameter to frame

Stefano Sabatini stefasab at gmail.com
Thu Aug 2 13:59:04 CEST 2012


The new name is more expressive, given that the frame is not necessarily
a picture but may be an audio frame.
---
 libavcodec/internal.h |    2 +-
 libavcodec/utils.c    |   32 ++++++++++++++++----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 3d62a0f..db8f374 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -122,7 +122,7 @@ unsigned int avpriv_toupper4(unsigned int x);
 /**
  * does needed setup of pkt_pts/pos and such for (re)get_buffer();
  */
-void ff_init_buffer_info(AVCodecContext *s, AVFrame *pic, enum AVMediaType type);
+void ff_init_buffer_info(AVCodecContext *s, AVFrame *frame, enum AVMediaType type);
 
 /**
  * Remove and free all side data from packet.
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 71ecf7e..851526f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -289,31 +289,31 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
     *width=FFALIGN(*width, align);
 }
 
-void ff_init_buffer_info(AVCodecContext *s, AVFrame *pic, enum AVMediaType type)
+void ff_init_buffer_info(AVCodecContext *s, AVFrame *frame, enum AVMediaType type)
 {
     if (s->pkt) {
-        pic->pkt_pts = s->pkt->pts;
-        pic->pkt_pos = s->pkt->pos;
-        pic->pkt_duration = s->pkt->duration;
+        frame->pkt_pts = s->pkt->pts;
+        frame->pkt_pos = s->pkt->pos;
+        frame->pkt_duration = s->pkt->duration;
     } else {
-        pic->pkt_pts = AV_NOPTS_VALUE;
-        pic->pkt_pos = -1;
-        pic->pkt_duration = 0;
+        frame->pkt_pts = AV_NOPTS_VALUE;
+        frame->pkt_pos = -1;
+        frame->pkt_duration = 0;
     }
-    pic->reordered_opaque= s->reordered_opaque;
+    frame->reordered_opaque = s->reordered_opaque;
 
     switch (type) {
     case AVMEDIA_TYPE_VIDEO:
-        pic->width               = s->width;
-        pic->height              = s->height;
-        pic->format              = s->pix_fmt;
-        pic->sample_aspect_ratio = s->sample_aspect_ratio;
+        frame->width               = s->width;
+        frame->height              = s->height;
+        frame->format              = s->pix_fmt;
+        frame->sample_aspect_ratio = s->sample_aspect_ratio;
         break;
     case AVMEDIA_TYPE_AUDIO:
-        pic->sample_rate    = s->sample_rate;
-        pic->format         = s->sample_fmt;
-        pic->channel_layout = s->channel_layout;
-        pic->channels       = s->channels;
+        frame->sample_rate    = s->sample_rate;
+        frame->format         = s->sample_fmt;
+        frame->channel_layout = s->channel_layout;
+        frame->channels       = s->channels;
         break;
     }
 }
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list