Ticket #599: 0001-Fixes-wrong-duration-in-.mov-file.-Issue-599.patch

File 0001-Fixes-wrong-duration-in-.mov-file.-Issue-599.patch, 931 bytes (added by oanastratulat, 5 years ago)

Patch for this bug.

  • libavformat/mov.c

    From 266b42f1c0cfaa0e44f328d9fd523612fce6022e Mon Sep 17 00:00:00 2001
    From: Oana Stratulat <oanaandreeastratulat@gmail.com>
    Date: Wed, 11 Jan 2012 03:50:12 +0200
    Subject: [PATCH] Fixes wrong duration in .mov file. Issue 599
    
    ---
     libavformat/mov.c |    2 ++
     1 files changed, 2 insertions(+), 0 deletions(-)
    
    diff --git a/libavformat/mov.c b/libavformat/mov.c
    index 05521fd..884079c 100644
    a b static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) 
    791791    av_dlog(c->fc, "time scale = %i\n", c->time_scale); 
    792792 
    793793    c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */ 
     794    //Set the AVFormatContext duration because the track duration is not accurate 
     795    c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale); 
    794796    avio_rb32(pb); /* preferred scale */ 
    795797 
    796798    avio_rb16(pb); /* preferred volume */