[FFmpeg-devel] [PATCH] Provide ready for use avio_interrupt_cb_read_int()

Andrey Utkin andrey.krieger.utkin at gmail.com
Sat Jul 13 19:09:44 CEST 2013


Implemented what was advised, but still not sure if it is useful for anybody.
---8<---
---
 libavformat/avio.c | 5 +++++
 libavformat/avio.h | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 2c7a35e..782432c 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -434,3 +434,8 @@ int ff_check_interrupt(AVIOInterruptCB *cb)
         return ret;
     return 0;
 }
+
+int avio_interrupt_cb_read_int(void *opaque)
+{
+  return *(int *)opaque;
+}
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 5bdbc62..bb1d5cc 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -478,4 +478,11 @@ int     avio_pause(AVIOContext *h, int pause);
 int64_t avio_seek_time(AVIOContext *h, int stream_index,
                        int64_t timestamp, int flags);
 
+/**
+ * Ready for use interrupt callback function.
+ * Casts opaque pointer to int and returns its value.
+ * @see AVIOInterruptCB
+ */
+int avio_interrupt_cb_read_int(void *opaque);
+
 #endif /* AVFORMAT_AVIO_H */
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list