[FFmpeg-devel] [PATCH]Remove panscan information in av_frame_copy_props() if resolution changes

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Aug 10 19:23:33 CEST 2014


Hi!

Attached is a new variant of "[RFC]Remove panscan side data in filters that 
change the resolution". I don't know how to correctly set the information 
based on the resolution change, as-is this patch works around ticket #3750 (a 
regression).

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 67a7d3e..38c0e5c 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -492,6 +492,9 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
 
     for (i = 0; i < src->nb_side_data; i++) {
         const AVFrameSideData *sd_src = src->side_data[i];
+        if (   sd_src->type == AV_FRAME_DATA_PANSCAN
+            && (src->width != dst->width || src->height != dst->height))
+            continue;
         AVFrameSideData *sd_dst = av_frame_new_side_data(dst, sd_src->type,
                                                          sd_src->size);
         if (!sd_dst) {


More information about the ffmpeg-devel mailing list