Message ID | 20191121110854.4615-1-ggarra13@gmail.com |
---|---|
State | New |
Headers | show |
On Thu, Nov 21, 2019 at 08:08:54 -0300, ggarra13@gmail.com wrote: > From: Gonzalo Garramuño <ggarra13@gmail.com> > Subject: [FFmpeg-devel] [PATCH] Added interrupt to av_read_frame() in utils.c, based on a patch by bsenftner at earthlink.net. This allows av_read_frame to return after a timeout period. Small nit regarding the commit message: Please prefix the first line with the affected "module", i.e. "avformat/utils", and keep the first line short. Then add an empty line(!), then the remaining text. You also don't need to describe the actual act of adding something. E.g. as such: --- avformat/utils: allow av_read_frame to return after a timeout period Based on a patch by bsenftner at earthlink.net. --- (Also, if this fixes some trac ticket, add a line/paragraph stating "Fixes #12345.") Cheers, Moritz
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)) {
From: Gonzalo Garramuño <ggarra13@gmail.com> --- libavformat/utils.c | 5 +++++ 1 file changed, 5 insertions(+)