[FFmpeg-cvslog] paf: fix audio packet duration

Paul B Mahol git at videolan.org
Fri Aug 3 17:18:42 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Aug  3 15:13:45 2012 +0000| [d84dd35f8ed8565bad6853828be619682303dbef] | committer: Paul B Mahol

paf: fix audio packet duration

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d84dd35f8ed8565bad6853828be619682303dbef
---

 libavformat/paf.c        |    2 +-
 tests/ref/fate/paf-audio |   10 +++++-----
 tests/ref/fate/paf-demux |   12 ++++++------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libavformat/paf.c b/libavformat/paf.c
index aeebaba..41d9140 100644
--- a/libavformat/paf.c
+++ b/libavformat/paf.c
@@ -200,7 +200,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
             return AVERROR(ENOMEM);
 
         memcpy(pkt->data, p->temp_audio_frame, p->audio_size);
-        pkt->duration     = PAF_SOUND_SAMPLES * p->audio_size / PAF_SOUND_FRAME_SIZE;
+        pkt->duration     = PAF_SOUND_SAMPLES * (p->audio_size / PAF_SOUND_FRAME_SIZE);
         pkt->flags       |= AV_PKT_FLAG_KEY;
         pkt->stream_index = 1;
         p->got_audio      = 0;
diff --git a/tests/ref/fate/paf-audio b/tests/ref/fate/paf-audio
index 918ecd7..ba47d5d 100644
--- a/tests/ref/fate/paf-audio
+++ b/tests/ref/fate/paf-audio
@@ -1,7 +1,7 @@
 #tb 0: 1/22050
 0,          0,          0,    57330,   229320, 0x062508b4
-0,      58718,      58718,    57330,   229320, 0x0a966cbf
-0,     117436,     117436,    57330,   229320, 0xee9bad45
-0,     176154,     176154,    57330,   229320, 0xde88274e
-0,     234872,     234872,    57330,   229320, 0x2fdeeaf6
-0,     293590,     293590,    57330,   229320, 0xf793fe5b
+0,      57330,      57330,    57330,   229320, 0x0a966cbf
+0,     114660,     114660,    57330,   229320, 0xee9bad45
+0,     171990,     171990,    57330,   229320, 0xde88274e
+0,     229320,     229320,    57330,   229320, 0x2fdeeaf6
+0,     286650,     286650,    57330,   229320, 0xf793fe5b
diff --git a/tests/ref/fate/paf-demux b/tests/ref/fate/paf-demux
index 868593b..689f9b1 100644
--- a/tests/ref/fate/paf-demux
+++ b/tests/ref/fate/paf-demux
@@ -1,7 +1,7 @@
 #tb 0: 1/10
 #tb 1: 1/22050
 0,          0,          0,        1,   262144, 0x7f9a3c6a
-1,          0,          0,    58718,   131072, 0x255a6ac2
+1,          0,          0,    57330,   131072, 0x255a6ac2
 0,          1,          1,        1,   260600, 0x0329e6f4
 0,          2,          2,        1,   259724, 0x2db0ad5e
 0,          3,          3,        1,   258616, 0xe666009d
@@ -28,7 +28,7 @@
 0,         24,         24,        1,   165584, 0xa6246dba
 0,         25,         25,        1,   159468, 0x7bc54abb
 0,         26,         26,        1,   153524, 0xd2774028
-1,      58718,      58718,    58718,   131072, 0xcc38a5e5
+1,      57330,      57330,    57330,   131072, 0xcc38a5e5
 0,         27,         27,        1,   147568, 0xd94b2368
 0,         28,         28,        1,   141536, 0xb512eae6
 0,         29,         29,        1,   135368, 0x9b6ea2b3
@@ -55,8 +55,8 @@
 0,         50,         50,        1,    48184, 0x0d5ae003
 0,         51,         51,        1,    48180, 0xdf91dfed
 0,         52,         52,        1,    48176, 0xf5eddfd6
+1,     114660,     114660,    57330,   131072, 0x4d9c2c7e
 0,         53,         53,        1,    48172, 0x415fdfc2
-1,     117436,     117436,    58718,   131072, 0x4d9c2c7e
 0,         54,         54,        1,    48168, 0xd0d8dfad
 0,         55,         55,        1,    48164, 0xa47edf97
 0,         56,         56,        1,    48160, 0xbc4adf80
@@ -82,8 +82,8 @@
 0,         76,         76,        1,   241160, 0x5978ea8c
 0,         77,         77,        1,   241156, 0xbc86ea78
 0,         78,         78,        1,   241152, 0x71b4ea63
+1,     171990,     171990,    57330,   131072, 0x1b512fb8
 0,         79,         79,        1,   241148, 0x78fbea4d
-1,     176154,     176154,    58718,   131072, 0x1b512fb8
 0,         80,         80,        1,   241144, 0xd263ea36
 0,         81,         81,        1,   237912, 0xcb5839a6
 0,         82,         82,        1,   229296, 0x350f07b6
@@ -109,9 +109,9 @@
 0,        102,        102,        1,    47388, 0xc602914b
 0,        103,        103,        1,    42276, 0x6b86b9dd
 0,        104,        104,        1,    36932, 0xea0d85cb
+1,     229320,     229320,    57330,   131072, 0x4e478505
 0,        105,        105,        1,    30408, 0xc7df6cba
 0,        106,        106,        1,    24468, 0x80007205
-1,     234872,     234872,    58718,   131072, 0x4e478505
 0,        107,        107,        1,    18572, 0xb4aa84d2
 0,        108,        108,        1,    12632, 0x12c2efb8
 0,        109,        109,        1,     6604, 0x75002817
@@ -136,10 +136,10 @@
 0,        128,        128,        1,   112044, 0x1d49b4ae
 0,        129,        129,        1,   105028, 0xd35649dd
 0,        130,        130,        1,    98012, 0x03ede949
+1,     286650,     286650,    57330,   131072, 0xb29e283e
 0,        131,        131,        1,    91000, 0x57128fb0
 0,        132,        132,        1,    84000, 0xf7ff39c0
 0,        133,        133,        1,    77004, 0xda18e580
-1,     293590,     293590,    58718,   131072, 0xb29e283e
 0,        134,        134,        1,    70004, 0x8eff8af4
 0,        135,        135,        1,    62992, 0x665831fd
 0,        136,        136,        1,    55976, 0x130ada75



More information about the ffmpeg-cvslog mailing list