[FFmpeg-cvslog] lavf: Explicitly convert types at function pointer assignment

Diego Biurrun git at videolan.org
Thu Mar 12 12:47:45 CET 2015


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Feb 10 16:02:30 2015 +0100| [b97f427fb56bdbf7de8e2d4b72d01114aa6eceda] | committer: Diego Biurrun

lavf: Explicitly convert types at function pointer assignment

This fixes a number of "assignment from incompatible pointer type" warnings.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b97f427fb56bdbf7de8e2d4b72d01114aa6eceda
---

 libavformat/avio.c    |    4 +++-
 libavformat/aviobuf.c |    4 +++-
 libavformat/swfenc.c  |    3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index f68994c..ff740a2 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -281,7 +281,9 @@ int ffurl_write(URLContext *h, const unsigned char *buf, int size)
     if (h->max_packet_size && size > h->max_packet_size)
         return AVERROR(EIO);
 
-    return retry_transfer_wrapper(h, buf, size, size, h->prot->url_write);
+    return retry_transfer_wrapper(h, buf, size, size,
+                                  (int (*)(struct URLContext *, uint8_t *, int))
+                                  h->prot->url_write);
 }
 
 int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index fb941c6..59f807c 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -692,7 +692,9 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
         return AVERROR(ENOMEM);
 
     *s = avio_alloc_context(buffer, buffer_size, h->flags & AVIO_FLAG_WRITE, h,
-                            ffurl_read, ffurl_write, ffurl_seek);
+                            (int (*)(void *, uint8_t *, int)) ffurl_read,
+                            (int (*)(void *, uint8_t *, int)) ffurl_write,
+                            (int64_t (*)(void *, int64_t, int)) ffurl_seek);
     if (!*s) {
         av_free(buffer);
         return AVERROR(ENOMEM);
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index a1fc7b3..877c847 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -427,7 +427,8 @@ static int swf_write_video(AVFormatContext *s,
         put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);
         avio_wl16(pb, swf->sound_samples);
         avio_wl16(pb, 0); // seek samples
-        av_fifo_generic_read(swf->audio_fifo, pb, frame_size, &avio_write);
+        av_fifo_generic_read(swf->audio_fifo, pb, frame_size,
+                             (void (*)(void *, void *, int)) &avio_write);
         put_swf_end_tag(s);
 
         /* update FIFO */



More information about the ffmpeg-cvslog mailing list