diff mbox

[FFmpeg-devel] libavformat/mux: Fix mixed delarations and code

Message ID 20190627174723.51998-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 45cfecdec645e0db0d2b8c76d6ece3860ab97c5b
Headers show

Commit Message

Andreas Rheinhardt June 27, 2019, 5:47 p.m. UTC
This commit fixes mixed declarations and code introduced in 1889e316.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
Sorry for the oversight.

 libavformat/mux.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

James Almer June 28, 2019, 1:01 a.m. UTC | #1
On 6/27/2019 2:47 PM, Andreas Rheinhardt wrote:
> This commit fixes mixed declarations and code introduced in 1889e316.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> Sorry for the oversight.
> 
>  libavformat/mux.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index 5e1ecd8485..21f10caf53 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -1005,10 +1005,11 @@ static int interleave_compare_dts(AVFormatContext *s, AVPacket *next,
>          int preload  = st ->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
>          int preload2 = st2->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
>          if (preload != preload2) {
> +            int64_t ts, ts2;
>              preload  *= s->audio_preload;
>              preload2 *= s->audio_preload;
> -            int64_t ts = av_rescale_q(pkt ->dts, st ->time_base, AV_TIME_BASE_Q) - preload;
> -            int64_t ts2= av_rescale_q(next->dts, st2->time_base, AV_TIME_BASE_Q) - preload2;
> +            ts = av_rescale_q(pkt ->dts, st ->time_base, AV_TIME_BASE_Q) - preload;
> +            ts2= av_rescale_q(next->dts, st2->time_base, AV_TIME_BASE_Q) - preload2;
>              if (ts == ts2) {
>                  ts  = ((uint64_t)pkt ->dts*st ->time_base.num*AV_TIME_BASE - (uint64_t)preload *st ->time_base.den)*st2->time_base.den
>                      - ((uint64_t)next->dts*st2->time_base.num*AV_TIME_BASE - (uint64_t)preload2*st2->time_base.den)*st ->time_base.den;

Pushed, thanks.
diff mbox

Patch

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 5e1ecd8485..21f10caf53 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1005,10 +1005,11 @@  static int interleave_compare_dts(AVFormatContext *s, AVPacket *next,
         int preload  = st ->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
         int preload2 = st2->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
         if (preload != preload2) {
+            int64_t ts, ts2;
             preload  *= s->audio_preload;
             preload2 *= s->audio_preload;
-            int64_t ts = av_rescale_q(pkt ->dts, st ->time_base, AV_TIME_BASE_Q) - preload;
-            int64_t ts2= av_rescale_q(next->dts, st2->time_base, AV_TIME_BASE_Q) - preload2;
+            ts = av_rescale_q(pkt ->dts, st ->time_base, AV_TIME_BASE_Q) - preload;
+            ts2= av_rescale_q(next->dts, st2->time_base, AV_TIME_BASE_Q) - preload2;
             if (ts == ts2) {
                 ts  = ((uint64_t)pkt ->dts*st ->time_base.num*AV_TIME_BASE - (uint64_t)preload *st ->time_base.den)*st2->time_base.den
                     - ((uint64_t)next->dts*st2->time_base.num*AV_TIME_BASE - (uint64_t)preload2*st2->time_base.den)*st ->time_base.den;