[FFmpeg-cvslog] assdec: fix qsort() callback signature

Mans Rullgard git at videolan.org
Sun Oct 28 14:29:11 CET 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Fri Oct 26 17:59:50 2012 +0100| [4cbae57cef65df8705b77cf882372f835a42d842] | committer: Mans Rullgard

assdec: fix qsort() callback signature

This changes the event_cmp() function to the correct signature,
avoiding an ugly cast.

Signed-off-by: Mans Rullgard <mans at mansr.com>

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

 libavformat/assdec.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 3d39845..0041ca4 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -68,8 +68,9 @@ static int64_t get_pts(const uint8_t *p)
     return sec*100+hsec;
 }
 
-static int event_cmp(uint8_t **a, uint8_t **b)
+static int event_cmp(const void *_a, const void *_b)
 {
+    const uint8_t *const *a = _a, *const *b = _b;
     return get_pts(*a) - get_pts(*b);
 }
 
@@ -131,7 +132,7 @@ static int read_header(AVFormatContext *s)
         p++;
     }
 
-    qsort(ass->event, ass->event_count, sizeof(*ass->event), (void*)event_cmp);
+    qsort(ass->event, ass->event_count, sizeof(*ass->event), event_cmp);
 
     return 0;
 



More information about the ffmpeg-cvslog mailing list