diff --git a/CHANGELOG b/CHANGELOG index a784ffc0..6a806998 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -33,6 +33,8 @@ Bugfixes * Fix http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2007x11x25x102808 (Angel Carpintero) * Avoid random errors , initialising some structs for V4L1 http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2007x11x26x010755 (Jason Sharpee & Angel Carpintero) + * Fix motion segfaul because ffmpeg API change + http://www.lavrsen.dk/twiki/bin/view/Motion/SupportQuestion2007x12x29x175530 (Angel Carpintero) 3.2.9 Formal Release - Summary of Changes diff --git a/CREDITS b/CREDITS index 83ca5342..abb53d5c 100644 --- a/CREDITS +++ b/CREDITS @@ -383,6 +383,8 @@ Angel Carpintero * Fix http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2007x11x25x102808 * Avoid random errors , initialising some structs for V4L1 http://www.lavrsen.dk/twiki/bin/view/Motion/BugReport2007x11x26x010755 (Jason Sharpee & Angel Carpintero) + * Fix motion segfaul because ffmpeg API change + http://www.lavrsen.dk/twiki/bin/view/Motion/SupportQuestion2007x12x29x175530 (Angel Carpintero) Jared D * Change bayer2rgb24() to fix a problem with sn9c102 driver diff --git a/ffmpeg.c b/ffmpeg.c index 00e3ea90..6ab741e5 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -36,6 +36,7 @@ # endif /* __GNUC__ */ #endif /* LIBAVCODEC_BUILD > 4680 */ + #if LIBAVFORMAT_BUILD >= 4616 /* The API for av_write_frame changed with FFmpeg version 0.4.9pre1. * It now uses an AVPacket struct instead of direct parameters to the @@ -188,8 +189,14 @@ URLProtocol file_protocol = { */ static int mpeg1_write_trailer(AVFormatContext *s) { +#if LIBAVFORMAT_BUILD >= 5200 + put_buffer(s->pb, mpeg1_trailer, 4); + put_flush_packet(s->pb); +#else put_buffer(&s->pb, mpeg1_trailer, 4); put_flush_packet(&s->pb); +#endif /* LIBAVFORMAT_BUILD >= 5200 */ + return 0; /* success */ } @@ -565,7 +572,11 @@ void ffmpeg_close(struct ffmpeg *ffmpeg) if (!(ffmpeg->oc->oformat->flags & AVFMT_NOFILE)) { /* close the output file */ +#if LIBAVFORMAT_BUILD >= 5200 + url_fclose(ffmpeg->oc->pb); +#else url_fclose(&ffmpeg->oc->pb); +#endif /* LIBAVFORMAT_BUILD >= 5200 */ } /* free the stream */