[PATCH] AU : demuxed packet size should be sample size aligned
Hi, As in subject. Fixes issue 1593. -- Jai Menon
nOn Sun, Dec 06, 2009 at 11:26:58PM +0530, Jai Menon wrote:
Hi,
As in subject. Fixes issue 1593.
-- Jai Menon
au.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) b6deb93d2a729411da7182658cfd362c573bfb29 audemux_fix.patch diff --git a/libavformat/au.c b/libavformat/au.c index 7f119e9..e4f5d9e 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -157,14 +157,14 @@ static int au_read_header(AVFormatContext *s, return 0; }
-#define MAX_SIZE 4096 +#define BLOCK_SIZE 2048
static int au_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret;
- ret= av_get_packet(s->pb, pkt, MAX_SIZE); + ret= av_get_packet(s->pb, pkt, BLOCK_SIZE*av_get_bits_per_sample(s->streams[0]->codec->codec_id)>>3);
i suspect this also needs to be multiplied by channels [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire
On Sun, Dec 06, 2009 at 10:35:39PM +0100, Michael Niedermayer wrote:
nOn Sun, Dec 06, 2009 at 11:26:58PM +0530, Jai Menon wrote:
Hi,
As in subject. Fixes issue 1593.
-- Jai Menon
au.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) b6deb93d2a729411da7182658cfd362c573bfb29 audemux_fix.patch diff --git a/libavformat/au.c b/libavformat/au.c index 7f119e9..e4f5d9e 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -157,14 +157,14 @@ static int au_read_header(AVFormatContext *s, return 0; }
-#define MAX_SIZE 4096 +#define BLOCK_SIZE 2048
static int au_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret;
- ret= av_get_packet(s->pb, pkt, MAX_SIZE); + ret= av_get_packet(s->pb, pkt, BLOCK_SIZE*av_get_bits_per_sample(s->streams[0]->codec->codec_id)>>3);
i suspect this also needs to be multiplied by channels
The opengroup spec doesn't say much about odd no. of channels but for completeness sake, updated patch attached. -- Jai Menon
On Mon, Dec 07, 2009 at 09:45:47AM +0530, Jai Menon wrote:
On Sun, Dec 06, 2009 at 10:35:39PM +0100, Michael Niedermayer wrote:
nOn Sun, Dec 06, 2009 at 11:26:58PM +0530, Jai Menon wrote:
Hi,
As in subject. Fixes issue 1593.
-- Jai Menon
au.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) b6deb93d2a729411da7182658cfd362c573bfb29 audemux_fix.patch diff --git a/libavformat/au.c b/libavformat/au.c index 7f119e9..e4f5d9e 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -157,14 +157,14 @@ static int au_read_header(AVFormatContext *s, return 0; }
-#define MAX_SIZE 4096 +#define BLOCK_SIZE 2048
static int au_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret;
- ret= av_get_packet(s->pb, pkt, MAX_SIZE); + ret= av_get_packet(s->pb, pkt, BLOCK_SIZE*av_get_bits_per_sample(s->streams[0]->codec->codec_id)>>3);
i suspect this also needs to be multiplied by channels
The opengroup spec doesn't say much about odd no. of channels but for completeness sake, updated patch attached.
-- Jai Menon
au.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) f83e1c2b4c115c8ddfc1ddd66c2669138289f336 audemux_fix.patch
ok if tested [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato
On Mon, Dec 07, 2009 at 02:10:24PM +0100, Michael Niedermayer wrote:
On Mon, Dec 07, 2009 at 09:45:47AM +0530, Jai Menon wrote:
On Sun, Dec 06, 2009 at 10:35:39PM +0100, Michael Niedermayer wrote:
nOn Sun, Dec 06, 2009 at 11:26:58PM +0530, Jai Menon wrote:
Hi,
As in subject. Fixes issue 1593.
-- Jai Menon
au.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) b6deb93d2a729411da7182658cfd362c573bfb29 audemux_fix.patch diff --git a/libavformat/au.c b/libavformat/au.c index 7f119e9..e4f5d9e 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -157,14 +157,14 @@ static int au_read_header(AVFormatContext *s, return 0; }
-#define MAX_SIZE 4096 +#define BLOCK_SIZE 2048
static int au_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret;
- ret= av_get_packet(s->pb, pkt, MAX_SIZE); + ret= av_get_packet(s->pb, pkt, BLOCK_SIZE*av_get_bits_per_sample(s->streams[0]->codec->codec_id)>>3);
i suspect this also needs to be multiplied by channels
The opengroup spec doesn't say much about odd no. of channels but for completeness sake, updated patch attached.
-- Jai Menon
au.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) f83e1c2b4c115c8ddfc1ddd66c2669138289f336 audemux_fix.patch
ok if tested
Applied. -- Jai Menon
participants (2)
-
jmenon86@gmail.com -
michaelni@gmx.at