avfilter/ff_filter_frame_needs_framing: fix handling of AV_NOPTS_VALUE
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 9 Oct 2013 14:24:00 +0000 (16:24 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 9 Oct 2013 14:33:18 +0000 (16:33 +0200)
Fixes Ticket3015

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/avfilter.c

index b5b3734944da7e1de5547b1d128e9b70916bbfca..7ce82f8011f95c2959b73b41fecccc701079a025 100644 (file)
@@ -1092,8 +1092,9 @@ static int ff_filter_frame_needs_framing(AVFilterLink *link, AVFrame *frame)
                 return 0;
             }
             av_frame_copy_props(pbuf, frame);
-            pbuf->pts = frame->pts +
-                        av_rescale_q(inpos, samples_tb, link->time_base);
+            pbuf->pts = frame->pts;
+            if (pbuf->pts != AV_NOPTS_VALUE)
+                pbuf->pts += av_rescale_q(inpos, samples_tb, link->time_base);
             pbuf->nb_samples = 0;
         }
         nb_samples = FFMIN(insamples,