Cherry picked from videolan repo
Some patches to be discussed [PATCH 1/3] In retry_transfer_wrapper, do not check url_interrupt_cb, [PATCH 2/3] retry_transfer_wrapper: check url_interrupt_cb at the end. [PATCH 3/3] Fix compilation on powerpc with --disable-altivec.
From: Baptiste Coudurier <baptiste.coudurier at gmail.com> --- libavformat/avio.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index a19ec37..cf07c6d 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -214,8 +214,6 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int len = 0; while (len < size_min) { - if (url_interrupt_cb()) - return AVERROR(EINTR); ret = transfer_func(h, buf+len, size-len); if (ret == AVERROR(EINTR)) continue; -- 1.7.4.1
Hi, On Fri, Mar 4, 2011 at 5:43 PM, Luca Barbato <lu_zero at gentoo.org> wrote:
From: Baptiste Coudurier <baptiste.coudurier at gmail.com>
--- ?libavformat/avio.c | ? ?2 -- ?1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/libavformat/avio.c b/libavformat/avio.c index a19ec37..cf07c6d 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -214,8 +214,6 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
? ? len = 0; ? ? while (len < size_min) { - ? ? ? ?if (url_interrupt_cb()) - ? ? ? ? ? ?return AVERROR(EINTR); ? ? ? ? ret = transfer_func(h, buf+len, size-len); ? ? ? ? if (ret == AVERROR(EINTR)) ? ? ? ? ? ? continue;
Queued. Ronald
From: Nicolas George <nicolas.george at normalesup.org> Checking it too early causes ffmpeg to fail to write the trailer of its output files if it was interrupted with the 'q' keystroke. Note that when a protocol is interrupted by url_interrupt_cb, some data may be silently discarded: the protocol context is not suitable for anything anymore. Signed-off-by: Nicolas George <nicolas.george at normalesup.org> --- libavformat/avio.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index cf07c6d..48f591b 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -230,6 +230,8 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int if (ret) fast_retries = FFMAX(fast_retries, 2); len += ret; + if (url_interrupt_cb()) + return AVERROR(EINTR); } return len; } -- 1.7.4.1
Hi, On Fri, Mar 4, 2011 at 5:43 PM, Luca Barbato <lu_zero at gentoo.org> wrote:
From: Nicolas George <nicolas.george at normalesup.org>
Checking it too early causes ffmpeg to fail to write the trailer of its output files if it was interrupted with the 'q' keystroke.
Note that when a protocol is interrupted by url_interrupt_cb, some data may be silently discarded: the protocol context is not suitable for anything anymore.
Signed-off-by: Nicolas George <nicolas.george at normalesup.org> --- ?libavformat/avio.c | ? ?2 ++ ?1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavformat/avio.c b/libavformat/avio.c index cf07c6d..48f591b 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -230,6 +230,8 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int ? ? ? ? if (ret) ? ? ? ? ? ?fast_retries = FFMAX(fast_retries, 2); ? ? ? ? len += ret; + ? ? ? ?if (url_interrupt_cb()) + ? ? ? ? ? ?return AVERROR(EINTR); ? ? } ? ? return len; ?} -- 1.7.4.1
This (and the previous one) is probably OK, I'd even merge them because you're temporarily breaking TCP support by only applying #1. Ronald
Le quartidi 14 vent?se, an CCXIX, Ronald S. Bultje a ?crit?:
This (and the previous one) is probably OK, I'd even merge them because you're temporarily breaking TCP support by only applying #1.
Probably not really breaking, as no one uses non-blocking TCP yet. But I agree that they should be merged if possible. Regards, -- Nicolas George
Hi, On Sat, Mar 5, 2011 at 3:46 AM, Nicolas George <nicolas.george at normalesup.org> wrote:
Le quartidi 14 vent?se, an CCXIX, Ronald S. Bultje a ?crit?:
This (and the previous one) is probably OK, I'd even merge them because you're temporarily breaking TCP support by only applying #1.
Probably not really breaking, as no one uses non-blocking TCP yet. But I agree that they should be merged if possible.
Well, they should be applied, so let's just live with it. Ronald
Hi On Sat, Mar 5, 2011 at 3:46 AM, Nicolas George <nicolas.george at normalesup.org> wrote:
Le quartidi 14 vent?se, an CCXIX, Ronald S. Bultje a ?crit?:
This (and the previous one) is probably OK, I'd even merge them because you're temporarily breaking TCP support by only applying #1.
Probably not really breaking, as no one uses non-blocking TCP yet. But I agree that they should be merged if possible.
Can you look at issue 2657 please? I thought this stuff was tested. Now streaming content hangs. Ronald
From: Carl Eugen Hoyos <cehoyos at ag.or.at> --- libavcodec/fmtconvert.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c index e26b899..bf762cc 100644 --- a/libavcodec/fmtconvert.c +++ b/libavcodec/fmtconvert.c @@ -63,6 +63,6 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) c->float_to_int16_interleave = float_to_int16_interleave_c; if (ARCH_ARM) ff_fmt_convert_init_arm(c, avctx); - if (ARCH_PPC) ff_fmt_convert_init_ppc(c, avctx); + if (HAVE_ALTIVEC) ff_fmt_convert_init_ppc(c, avctx); if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx); } -- 1.7.4.1
Hi, On Fri, Mar 4, 2011 at 5:43 PM, Luca Barbato <lu_zero at gentoo.org> wrote:
From: Carl Eugen Hoyos <cehoyos at ag.or.at>
--- ?libavcodec/fmtconvert.c | ? ?2 +- ?1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c index e26b899..bf762cc 100644 --- a/libavcodec/fmtconvert.c +++ b/libavcodec/fmtconvert.c @@ -63,6 +63,6 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) ? ? c->float_to_int16_interleave ?= float_to_int16_interleave_c;
? ? if (ARCH_ARM) ff_fmt_convert_init_arm(c, avctx); - ? ?if (ARCH_PPC) ff_fmt_convert_init_ppc(c, avctx); + ? ?if (HAVE_ALTIVEC) ff_fmt_convert_init_ppc(c, avctx); ? ? if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx); ?} -- 1.7.4.1
Justin already had a better version of this patch. Having a _ppc function under HAVE_ALTIVEC is plain wrong, for one the function doesn't do runtime flag detection and thus fails if the binary was compiled with altivec support but the system has no altivec. Ronald
On Sat, Mar 05, 2011 at 01:37:16 (CET), Ronald S. Bultje wrote:
Hi,
On Fri, Mar 4, 2011 at 5:43 PM, Luca Barbato <lu_zero at gentoo.org> wrote:
From: Carl Eugen Hoyos <cehoyos at ag.or.at>
--- ?libavcodec/fmtconvert.c | ? ?2 +- ?1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c index e26b899..bf762cc 100644 --- a/libavcodec/fmtconvert.c +++ b/libavcodec/fmtconvert.c @@ -63,6 +63,6 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) ? ? c->float_to_int16_interleave ?= float_to_int16_interleave_c;
? ? if (ARCH_ARM) ff_fmt_convert_init_arm(c, avctx); - ? ?if (ARCH_PPC) ff_fmt_convert_init_ppc(c, avctx); + ? ?if (HAVE_ALTIVEC) ff_fmt_convert_init_ppc(c, avctx); ? ? if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx); ?} -- 1.7.4.1
Justin already had a better version of this patch. Having a _ppc function under HAVE_ALTIVEC is plain wrong, for one the function doesn't do runtime flag detection and thus fails if the binary was compiled with altivec support but the system has no altivec.
NB: Code that was compiled with altivec support will not run on systems without. At all! -- Gruesse/greetings, Reinhard Tartler, KeyID 945348A4
participants (4)
-
lu_zero@gentoo.org -
nicolas.george@normalesup.org -
rsbultje@gmail.com -
siretart@tauware.de