History

lavfi: add libavfilter/avcodec.h and avfilter_copy_frame_props()

avfilter_copy_frame_props() avoids code duplication and increases robustness. The added files libavfilter/avcodec.[ch] are used for containing utilities useful for gluing togheter libavfilter and libavcodec.

Stefano Sabatini committed 15 years ago

Commit 566666c1 parent 18ded939 files · +99 −16Browse files

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

Unified · Split

libavfilter/vsrc_buffer.c+3−6
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 */
2525
2626 #include "avfilter.h"
27+#include "avcodec.h"
2728 #include "vsrc_buffer.h"
2829 #include "libavutil/imgutils.h"
2930
@@ -193,13 +194,9 @@ static int request_frame(AVFilterLink *link) · 163 unmodified lines
193194 av_image_copy(picref->data, picref->linesize,
194195 c->frame.data, c->frame.linesize,
195196 picref->format, link->w, link->h);
197+ avfilter_copy_frame_props(picref, &c->frame);
198+ picref->pts = c->pts;
196199
197− picref->pts = c->pts;
198− picref->video->sample_aspect_ratio = c->frame.sample_aspect_ratio;
199− picref->video->interlaced = c->frame.interlaced_frame;
200− picref->video->top_field_first = c->frame.top_field_first;
201− picref->video->key_frame = c->frame.key_frame;
202− picref->video->pict_type = c->frame.pict_type;
203200 avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
204201 avfilter_draw_slice(link, 0, link->h, 1);
205202 avfilter_end_frame(link);

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