Author: StevenM
Date: 2011-10-01 14:55:05 +0200 (Sat, 01 Oct 2011)
New Revision: 534
Modified:
trunk/ffmpeg.c
Log:
Apply the ffmpeg 0.8 compatibility patch
Modified: trunk/ffmpeg.c
===================================================================
--- trunk/ffmpeg.c 2011-09-05 09:52:17 UTC (rev 533)
+++ trunk/ffmpeg.c 2011-10-01 12:55:05 UTC (rev 534)
@@ -277,8 +277,12 @@
/* Register the append file protocol. */
#if LIBAVFORMAT_BUILD >= (52<<16 | 31<<8)
+#if FF_API_REGISTER_PROTOCOL
av_register_protocol(&mpeg1_file_protocol);
#else
+ av_register_protocol2(&mpeg1_file_protocol, sizeof(mpeg1_file_protocol));
+#endif
+#else
register_protocol(&mpeg1_file_protocol);
#endif
}
@@ -472,7 +476,11 @@
ffmpeg->c = c = AVSTREAM_CODEC_PTR(ffmpeg->video_st);
c->codec_id = ffmpeg->oc->oformat->video_codec;
+#if LIBAVCODEC_VERSION_MAJOR < 53
c->codec_type = CODEC_TYPE_VIDEO;
+#else
+ c->codec_type = AVMEDIA_TYPE_VIDEO;
+#endif
is_mpeg1 = c->codec_id == CODEC_ID_MPEG1VIDEO;
if (strcmp(ffmpeg_video_codec, "ffv1") == 0)
@@ -789,7 +797,11 @@
if (ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE) {
/* Raw video case. The API will change slightly in the near future for that. */
#ifdef FFMPEG_AVWRITEFRAME_NEWAPI
+#if LIBAVCODEC_VERSION_MAJOR < 53
pkt.flags |= PKT_FLAG_KEY;
+#else
+ pkt.flags |= AV_PKT_FLAG_KEY;
+#endif
pkt.data = (uint8_t *)pic;
pkt.size = sizeof(AVPicture);
ret = av_write_frame(ffmpeg->oc, &pkt);
@@ -813,7 +825,11 @@
pkt.pts = AVSTREAM_CODEC_PTR(ffmpeg->video_st)->coded_frame->pts;
if (AVSTREAM_CODEC_PTR(ffmpeg->video_st)->coded_frame->key_frame)
+#if LIBAVCODEC_VERSION_MAJOR < 53
pkt.flags |= PKT_FLAG_KEY;
+#else
+ pkt.flags |= AV_PKT_FLAG_KEY;
+#endif
pkt.data = ffmpeg->video_outbuf;
|