1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

lavc: rename the argument of avcodec_alloc_frame/get_frame_defaults

AVFrame is used for both audio and video, so calling the argument 'pic'
is misleading.
This commit is contained in:
Anton Khirnov
2012-09-21 08:28:49 +02:00
parent cee1950bbb
commit a83499b13b
2 changed files with 12 additions and 12 deletions

View File

@@ -3267,9 +3267,9 @@ AVFrame *avcodec_alloc_frame(void);
/** /**
* Set the fields of the given AVFrame to default values. * Set the fields of the given AVFrame to default values.
* *
* @param pic The AVFrame of which the fields should be set to default values. * @param frame The AVFrame of which the fields should be set to default values.
*/ */
void avcodec_get_frame_defaults(AVFrame *pic); void avcodec_get_frame_defaults(AVFrame *frame);
/** /**
* Initialize the AVCodecContext to use the given AVCodec. Prior to using this * Initialize the AVCodecContext to use the given AVCodec. Prior to using this

View File

@@ -633,26 +633,26 @@ enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum
return fmt[0]; return fmt[0];
} }
void avcodec_get_frame_defaults(AVFrame *pic) void avcodec_get_frame_defaults(AVFrame *frame)
{ {
memset(pic, 0, sizeof(AVFrame)); memset(frame, 0, sizeof(AVFrame));
pic->pts = AV_NOPTS_VALUE; frame->pts = AV_NOPTS_VALUE;
pic->key_frame = 1; frame->key_frame = 1;
pic->sample_aspect_ratio = (AVRational) {0, 1 }; frame->sample_aspect_ratio = (AVRational) {0, 1 };
pic->format = -1; /* unknown */ frame->format = -1; /* unknown */
} }
AVFrame *avcodec_alloc_frame(void) AVFrame *avcodec_alloc_frame(void)
{ {
AVFrame *pic = av_malloc(sizeof(AVFrame)); AVFrame *frame = av_malloc(sizeof(AVFrame));
if (pic == NULL) if (frame == NULL)
return NULL; return NULL;
avcodec_get_frame_defaults(pic); avcodec_get_frame_defaults(frame);
return pic; return frame;
} }
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)