diff mbox

[FFmpeg-devel,2/5] ffmpeg: rename a variable.

Message ID 20170907085939.21770-2-george@nsup.org
State Accepted
Commit dfed8e2cbb48d750a16b6c2b4f764250f69ab4df
Headers show

Commit Message

Nicolas George Sept. 7, 2017, 8:59 a.m. UTC
Makes the reason of the "FIXME" comment more obvious.
Avoid name conflicts for the next commit.

Signed-off-by: Nicolas George <george@nsup.org>
---
 ffmpeg.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)


This patch and the following have already been discussed. The changes are
tested and work, but they were on hold pending possible checks by Michael.
Since nothing comes, I will push soon unless somebody objects with new
arguments.

With this patch series, when a filter uses ff_request_frame() and it returns
EOF, inlink->current_pts is correctly set to the end timestamp of the
stream.

It applies in particular to Thierry's patch for vf_fps.

Comments

Michael Niedermayer Sept. 7, 2017, 10:44 p.m. UTC | #1
On Thu, Sep 07, 2017 at 10:59:36AM +0200, Nicolas George wrote:
> Makes the reason of the "FIXME" comment more obvious.
> Avoid name conflicts for the next commit.
> 
> Signed-off-by: Nicolas George <george@nsup.org>
> ---
>  ffmpeg.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

LGTM

thx

[...]
Nicolas George Sept. 8, 2017, 8:36 a.m. UTC | #2
Le duodi 22 fructidor, an CCXXV, Michael Niedermayer a écrit :
> LGTM

Thanks, series pushed.

Regards,
diff mbox

Patch

diff --git a/ffmpeg.c b/ffmpeg.c
index ccb6638e0a..c8ee64621c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2628,7 +2628,7 @@  static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
 
     // while we have more to decode or while the decoder did output something on EOF
     while (ist->decoding_needed) {
-        int64_t duration = 0;
+        int64_t duration_dts = 0;
         int got_output = 0;
         int decode_failed = 0;
 
@@ -2645,22 +2645,22 @@  static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
                                    &decode_failed);
             if (!repeating || !pkt || got_output) {
                 if (pkt && pkt->duration) {
-                    duration = av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
+                    duration_dts = av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
                 } else if(ist->dec_ctx->framerate.num != 0 && ist->dec_ctx->framerate.den != 0) {
                     int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict+1 : ist->dec_ctx->ticks_per_frame;
-                    duration = ((int64_t)AV_TIME_BASE *
+                    duration_dts = ((int64_t)AV_TIME_BASE *
                                     ist->dec_ctx->framerate.den * ticks) /
                                     ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame;
                 }
 
-                if(ist->dts != AV_NOPTS_VALUE && duration) {
-                    ist->next_dts += duration;
+                if(ist->dts != AV_NOPTS_VALUE && duration_dts) {
+                    ist->next_dts += duration_dts;
                 }else
                     ist->next_dts = AV_NOPTS_VALUE;
             }
 
             if (got_output)
-                ist->next_pts += duration; //FIXME the duration is not correct in some cases
+                ist->next_pts += duration_dts; //FIXME the duration is not correct in some cases
             break;
         case AVMEDIA_TYPE_SUBTITLE:
             if (repeating)