diff mbox

[FFmpeg-devel,1/3] apc: Read duration from file

Message ID 1544441511.21980.17.camel@acc.umu.se
State New
Headers show

Commit Message

Tomas Härdin Dec. 10, 2018, 11:31 a.m. UTC
The first in a series of CRYO APC patches

/Tomas

Comments

Paul B Mahol Dec. 10, 2018, 3:18 p.m. UTC | #1
On 12/10/18, Tomas Härdin <tjoppen@acc.umu.se> wrote:
> The first in a series of CRYO APC patches
>
> /Tomas

LGTM
diff mbox

Patch

From d0988031b97c22a9bda6832eb8871e917335aae6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <tjoppen@acc.umu.se>
Date: Fri, 23 Nov 2018 14:12:50 +0100
Subject: [PATCH 1/3] apc: Read duration from file

---
 libavformat/apc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/apc.c b/libavformat/apc.c
index b180a50c9b..52f93df3ca 100644
--- a/libavformat/apc.c
+++ b/libavformat/apc.c
@@ -49,8 +49,9 @@  static int apc_read_header(AVFormatContext *s)
     st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
     st->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_APC;
 
-    avio_rl32(pb); /* number of samples */
+    st->duration = avio_rl32(pb); /* number of samples */
     st->codecpar->sample_rate = avio_rl32(pb);
+    avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
 
     /* initial predictor values for adpcm decoder */
     if (ff_get_extradata(s, st->codecpar, pb, 2 * 4) < 0)
-- 
2.11.0