History

lavc: add a sample_aspect_ratio field to AVFrame

The sample aspect ratio is a per-frame property, so it makes sense to define it in AVFrame rather than in the codec/stream context. Simplify application-level sample aspect ratio information extraction, and allow further simplifications.

Stefano Sabatini committed 15 years ago

Commit 77e9dee1 parent 1ba572710 files · +28 −15Browse files

Showing the changes to libavfilter/vsrc_buffer.c (1 of 10 files). Show all

Unified · Split

libavfilter/vsrc_buffer.c+5−5
@@ -39,7 +39,7 @@ typedef struct { · 38 unmodified lines
3939 } BufferSourceContext;
4040
4141 int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame,
42− int64_t pts, AVRational pixel_aspect, int width,
42+ int64_t pts, int width,
4343 int height, enum PixelFormat pix_fmt,
4444 const char *sws_param)
4545 {
@@ -104,20 +104,20 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, · 58 unmodified lines
104104 c->frame.top_field_first = frame->top_field_first;
105105 c->frame.key_frame = frame->key_frame;
106106 c->frame.pict_type = frame->pict_type;
107+ c->frame.sample_aspect_ratio = frame->sample_aspect_ratio;
107108 c->pts = pts;
108− c->pixel_aspect = pixel_aspect;
109109 c->has_frame = 1;
110110
111111 return 0;
112112 }
113113
114114 int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame,
115− int64_t pts, AVRational pixel_aspect)
115+ int64_t pts)
116116 {
117117 BufferSourceContext *c = buffer_filter->priv;
118118
119119 return av_vsrc_buffer_add_frame2(buffer_filter, frame,
120− pts, pixel_aspect, c->w,
120+ pts, c->w,
121121 c->h, c->pix_fmt, "");
122122 }
123123
@@ -190,7 +190,7 @@ static int request_frame(AVFilterLink *link) · 66 unmodified lines
190190 picref->format, link->w, link->h);
191191
192192 picref->pts = c->pts;
193− picref->video->pixel_aspect = c->pixel_aspect;
193+ picref->video->pixel_aspect = c->frame.sample_aspect_ratio;
194194 picref->video->interlaced = c->frame.interlaced_frame;
195195 picref->video->top_field_first = c->frame.top_field_first;
196196 picref->video->key_frame = c->frame.key_frame;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t