Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10949/src

Modified Files:
        FFmpeg.cpp FFmpeg.h 
Log Message:
Forward-ported FFmpeg-0.5 compatibility code

Index: FFmpeg.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/FFmpeg.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- FFmpeg.cpp  12 Jul 2009 11:26:09 -0000      1.42
+++ FFmpeg.cpp  31 Aug 2009 21:38:29 -0000      1.43
@@ -816,9 +816,14 @@
    INITDYN(avformat,get_buffer);
    INITDYN(avformat,match_ext);
 
-   INITDYN(codec,avcodec_init);
+#if FFMPEG_STABLE
+   INITDYN(avformat,av_init_packet);
+#else
    INITDYN(codec,av_init_packet);
    INITDYN(codec,av_free_packet);
+#endif
+
+   INITDYN(codec,avcodec_init);
    INITDYN(codec,avcodec_find_encoder);
    INITDYN(codec,avcodec_find_encoder_by_name);
    INITDYN(codec,avcodec_find_decoder);
@@ -843,13 +848,19 @@
    INITDYN(util,av_free);
    INITDYN(util,av_log_set_callback);
    INITDYN(util,av_log_default_callback);
+#if FFMPEG_STABLE
+   INITDYN(util,av_fifo_init);
+   INITDYN(util,av_fifo_read);
+   INITDYN(util,av_fifo_realloc);
+#else
    INITDYN(util,av_fifo_alloc);
-   INITDYN(util,av_fifo_free);
    INITDYN(util,av_fifo_generic_read);
-   INITDYN(util,av_fifo_size);
-   INITDYN(util,av_fifo_generic_write);
    INITDYN(util,av_fifo_realloc2);
+#endif
+   INITDYN(util,av_fifo_free);
+   INITDYN(util,av_fifo_size);
    INITDYN(util,av_malloc);
+   INITDYN(util,av_fifo_generic_write);
    INITDYN(util,av_freep);
    INITDYN(util,av_rescale_q);
    INITDYN(util,av_strstart);

Index: FFmpeg.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/FFmpeg.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- FFmpeg.h    12 Jul 2009 11:26:09 -0000      1.42
+++ FFmpeg.h    31 Aug 2009 21:38:29 -0000      1.43
@@ -35,6 +35,7 @@
    // knowing the value of EINVAL...see bottom of avcodec.h.  Not doing
    // so will produce positive error returns when they should be < 0.
    #include <errno.h>
+
    #include <libavcodec/avcodec.h>
    #include <libavformat/avformat.h>
    #include <libavutil/fifo.h>
@@ -72,6 +73,14 @@
 
 /* from here on in, this stuff only applies when ffmpeg is available */
 #if defined(USE_FFMPEG)
+
+/* This is a bit shortsighted (matches only 0.5 exactly), but i can't come up 
with anything smarter at the moment */
+#if LIBAVFORMAT_VERSION_MAJOR == 52 && LIBAVFORMAT_VERSION_MINOR == 31 && 
LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR == 20
+#define FFMPEG_STABLE 1
+#else
+#define FFMPEG_STABLE 0
+#endif
+
 int ufile_fopen(ByteIOContext **s, const wxString & name, int flags);
 
 #if defined(__WXMSW__)
@@ -218,19 +227,22 @@
    int               (*av_interleaved_write_frame)    (AVFormatContext *s, 
AVPacket *pkt);
    int               (*av_write_frame)                (AVFormatContext *s, 
AVPacket *pkt);
    void              (*av_init_packet)                (AVPacket *pkt);
-   void              (*av_free_packet)                (AVPacket *pkt);
-   //int               (*av_fifo_init)                  (AVFifoBuffer *f, int 
size);
-   AVFifoBuffer*     (*av_fifo_alloc)                 (unsigned int size);
+   int               (*av_fifo_generic_write)         (AVFifoBuffer *f, void 
*src, int size, int (*func)(void*, void*, int));   
    void              (*av_fifo_free)                  (AVFifoBuffer *f);
-//   int               (*av_fifo_read)                  (AVFifoBuffer *f, 
uint8_t *buf, int buf_size);
-   int               (*av_fifo_generic_read)          (AVFifoBuffer *f, 
uint8_t *buf, int buf_size, int (*func)(void*, void*, int));
    int               (*av_fifo_size)                  (AVFifoBuffer *f);
-   int               (*av_fifo_generic_write)         (AVFifoBuffer *f, void 
*src, int size, int (*func)(void*, void*, int));
-//   void              (*av_fifo_realloc)               (AVFifoBuffer *f, 
unsigned int size);
-   int               (*av_fifo_realloc2)              (AVFifoBuffer *f, 
unsigned int size);
    void*             (*av_malloc)                     (unsigned int size);
    void              (*av_freep)                      (void *ptr);
    int64_t           (*av_rescale_q)                  (int64_t a, AVRational 
bq, AVRational cq);
+#if !FFMPEG_STABLE
+   void              (*av_free_packet)                (AVPacket *pkt);
+   AVFifoBuffer*     (*av_fifo_alloc)                 (unsigned int size);
+   int               (*av_fifo_generic_read)          (AVFifoBuffer *f, 
uint8_t *buf, int buf_size, int (*func)(void*, void*, int));
+   int               (*av_fifo_realloc2)              (AVFifoBuffer *f, 
unsigned int size);
+#else
+   int               (*av_fifo_init)                  (AVFifoBuffer *f, int 
size);
+   int               (*av_fifo_read)                  (AVFifoBuffer *f, 
uint8_t *buf, int buf_size);
+   void              (*av_fifo_realloc)               (AVFifoBuffer *f, 
unsigned int size);
+#endif
 
    ///! Finds libav* libraries
    ///\return true if found, false if not found


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to