diff mbox

[FFmpeg-devel] Added interrupt to av_read_frame() in utils.c. This allows av_read_frame to return after a timeout period.

Message ID 20191120223329.4923-1-ggarra13@gmail.com
State New
Headers show

Commit Message

Gonzalo Garramuño Nov. 20, 2019, 10:33 p.m. UTC
From: Gonzalo Garramuño <ggarra13@gmail.com>

---
 libavformat/utils.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Carl Eugen Hoyos Nov. 21, 2019, 9:42 a.m. UTC | #1
Am Mi., 20. Nov. 2019 um 23:42 Uhr schrieb <ggarra13@gmail.com>:
>
> From: Gonzalo Garramuño <ggarra13@gmail.com>

I was under the impression that the following patch was written
by Blake Senftner, bsenftner at earthlink.net
Am I wrong?

>  libavformat/utils.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 8196442dd1..c3c2c77c0c 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -1838,6 +1838,11 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
>              }
>          }
>
> +        if (ff_check_interrupt(&s->interrupt_callback)) {
> +            av_log(s, AV_LOG_DEBUG, "interrupted\n");
> +            return AVERROR_EXIT;
> +        }

Carl Eugen
Gonzalo Garramuño Nov. 21, 2019, 10:18 a.m. UTC | #2
El 21/11/19 a las 06:42, Carl Eugen Hoyos escribió:
> Am Mi., 20. Nov. 2019 um 23:42 Uhr schrieb <ggarra13@gmail.com>:
>> From: Gonzalo Garramuño <ggarra13@gmail.com>
> I was under the impression that the following patch was written
> by Blake Senftner, bsenftner at earthlink.net
> Am I wrong?
He wrote the original patch that had the exit interrupt at the beginning 
of the loop.  I wrote the one here where the exit is at the middle of 
the loop.
In any case, I don't know how to send an email for another user with git.
Carl Eugen Hoyos Nov. 21, 2019, 10:49 a.m. UTC | #3
Am Do., 21. Nov. 2019 um 11:42 Uhr schrieb Gonzalo Garramuño
<ggarra13@gmail.com>:
>
>
>
> El 21/11/19 a las 06:42, Carl Eugen Hoyos escribió:
> > Am Mi., 20. Nov. 2019 um 23:42 Uhr schrieb <ggarra13@gmail.com>:
> >> From: Gonzalo Garramuño <ggarra13@gmail.com>
> > I was under the impression that the following patch was written
> > by Blake Senftner, bsenftner at earthlink.net
> > Am I wrong?
> He wrote the original patch that had the exit interrupt at the beginning
> of the loop.  I wrote the one here where the exit is at the middle of
> the loop.

If you believe that you wrote the patch (and not Blake) that was based
on his patch, then please mention in your commit message that your
patch is "based on a patch by Blake Senftner".

> In any case, I don't know how to send an email for another user with git.

$ git commit --author="Blake Senftner <bsenftner at earhlink,net>"

Carl Eugen
diff mbox

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8196442dd1..c3c2c77c0c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1838,6 +1838,11 @@  int av_read_frame(AVFormatContext *s, AVPacket *pkt)
             }
         }
 
+        if (ff_check_interrupt(&s->interrupt_callback)) {
+            av_log(s, AV_LOG_DEBUG, "interrupted\n");
+            return AVERROR_EXIT;
+        }
+
         ret = read_frame_internal(s, pkt);
         if (ret < 0) {
             if (pktl && ret != AVERROR(EAGAIN)) {