~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/imbuf/intern/util.c

  • Committer: Bazaar Package Importer
  • Author(s): Kevin Roy
  • Date: 2011-06-24 11:13:28 UTC
  • mto: (14.1.6 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20110624111328-27ribg6l36edf2ay
Tags: upstream-2.58-svn37702
ImportĀ upstreamĀ versionĀ 2.58-svn37702

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 * ***** END GPL LICENSE BLOCK *****
27
27
 * util.c
28
28
 *
29
 
 * $Id: util.c 35239 2011-02-27 20:23:21Z jesterking $
 
29
 * $Id: util.c 37586 2011-06-17 08:52:15Z zanqdo $
30
30
 */
31
31
 
32
32
/** \file blender/imbuf/intern/util.c
63
63
#include <libavdevice/avdevice.h>
64
64
#include <libavutil/log.h>
65
65
 
66
 
#if LIBAVFORMAT_VERSION_INT < (49 << 16)
67
 
#define FFMPEG_OLD_FRAME_RATE 1
68
 
#else
69
 
#define FFMPEG_CODEC_IS_POINTER 1
70
 
#endif
 
66
#include "ffmpeg_compat.h"
71
67
 
72
68
#endif
73
69
 
146
142
        ".flac",
147
143
        ".wma",
148
144
        ".eac3",
 
145
        ".aif",
 
146
        ".aiff",
 
147
        ".m4a",
149
148
        NULL};
150
149
 
151
150
static int IMB_ispic_name(const char *name)
241
240
        }
242
241
}
243
242
 
244
 
#ifdef FFMPEG_CODEC_IS_POINTER
245
 
static AVCodecContext* get_codec_from_stream(AVStream* stream)
246
 
{
247
 
        return stream->codec;
248
 
}
249
 
#else
250
 
static AVCodecContext* get_codec_from_stream(AVStream* stream)
251
 
{
252
 
        return &stream->codec;
253
 
}
254
 
#endif
255
 
 
256
 
 
257
243
static int isffmpeg (const char *filename) {
258
244
        AVFormatContext *pFormatCtx;
259
245
        unsigned int i;
284
270
                return 0;
285
271
        }
286
272
 
287
 
        if(UTIL_DEBUG) dump_format(pFormatCtx, 0, filename, 0);
 
273
        if(UTIL_DEBUG) av_dump_format(pFormatCtx, 0, filename, 0);
288
274
 
289
275
 
290
276
                /* Find the first video stream */
291
277
        videoStream=-1;
292
278
        for(i=0; i<pFormatCtx->nb_streams; i++)
293
279
                if(pFormatCtx->streams[i] &&
294
 
                   get_codec_from_stream(pFormatCtx->streams[i]) && 
295
 
                  (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO))
 
280
                   pFormatCtx->streams[i]->codec && 
 
281
                  (pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO))
296
282
                {
297
283
                        videoStream=i;
298
284
                        break;
303
289
                return 0;
304
290
        }
305
291
 
306
 
        pCodecCtx = get_codec_from_stream(pFormatCtx->streams[videoStream]);
 
292
        pCodecCtx = pFormatCtx->streams[videoStream]->codec;
307
293
 
308
294
                /* Find the decoder for the video stream */
309
295
        pCodec=avcodec_find_decoder(pCodecCtx->codec_id);