[FFmpeg-cvslog] ffmpeg: disable dr1 when frame sizes change.

Michael Niedermayer git at videolan.org
Thu Mar 29 04:32:36 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Mar 29 04:13:27 2012 +0200| [e5c3b51cd1ba5167ac224c41b905928f1bd0eb8d] | committer: Michael Niedermayer

ffmpeg: disable dr1 when frame sizes change.

dr1 seems to work fine with frame size changes but many filters
cant handle it yet. Simply disabling it forces the alternative
non dr1 code path which has been tested more completely and
is known to handle frame size changes in a wider varity of
cases.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5c3b51cd1ba5167ac224c41b905928f1bd0eb8d
---

 ffmpeg.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 72189f1..173d830 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2174,10 +2174,13 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
     for(i=0;i<nb_output_streams;i++) {
         OutputStream *ost = ost = &output_streams[i];
         if(check_output_constraints(ist, ost) && ost->encoding_needed){
+            int changed =    ist->st->codec->width   != ost->input_video_filter->outputs[0]->w
+                          || ist->st->codec->height  != ost->input_video_filter->outputs[0]->h
+                          || ist->st->codec->pix_fmt != ost->input_video_filter->outputs[0]->format;
             if (!frame_sample_aspect->num)
                 *frame_sample_aspect = ist->st->sample_aspect_ratio;
             decoded_frame->pts = ist->pts;
-            if (ist->dr1 && decoded_frame->type==FF_BUFFER_TYPE_USER) {
+            if (ist->dr1 && decoded_frame->type==FF_BUFFER_TYPE_USER && !changed) {
                 FrameBuffer      *buf = decoded_frame->opaque;
                 AVFilterBufferRef *fb = avfilter_get_video_buffer_ref_from_arrays(
                                             decoded_frame->data, decoded_frame->linesize,



More information about the ffmpeg-cvslog mailing list