Gentoo Archives: gentoo-commits

From: "Brian Evans (grknight)" <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-php/ffmpeg-php/files: ffmpeg-php-0.6.0-api.patch
Date: Thu, 02 Oct 2014 20:42:21
Message-Id: 20141002204218.A49C26CB9@oystercatcher.gentoo.org
1 grknight 14/10/02 20:42:18
2
3 Added: ffmpeg-php-0.6.0-api.patch
4 Log:
5 Revbump; Fix bug 513384; drop 5.3; add 5.5 and 5.6
6
7 (Portage version: 2.2.14_rc1/cvs/Linux x86_64, signed Manifest commit with key 67C78E1D)
8
9 Revision Changes Path
10 1.1 dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-api.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-api.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-api.patch?rev=1.1&content-type=text/plain
14
15 Index: ffmpeg-php-0.6.0-api.patch
16 ===================================================================
17 diff --git a/ffmpeg_movie.c b/ffmpeg_movie.c
18 index 0ce2c0f..6b77eb5 100644
19 --- a/ffmpeg_movie.c
20 +++ b/ffmpeg_movie.c
21 @@ -39,6 +39,7 @@
22 #include "ext/standard/info.h"
23
24 #include <libavcodec/avcodec.h>
25 +#include <libavcodec/version.h>
26 #include <libavformat/avformat.h>
27 #include <libavutil/pixfmt.h>
28 #include <libavutil/pixdesc.h>
29 @@ -252,17 +257,17 @@ static int _php_open_movie_file(ff_movie_context *ffmovie_ctx,
30 char* filename)
31 {
32 if (ffmovie_ctx->fmt_ctx) {
33 - av_close_input_file(ffmovie_ctx->fmt_ctx);
34 + avformat_close_input(&ffmovie_ctx->fmt_ctx);
35 ffmovie_ctx->fmt_ctx = NULL;
36 }
37
38 /* open the file with generic libav function */
39 if (avformat_open_input(&ffmovie_ctx->fmt_ctx, filename, NULL, NULL) < 0) {
40 return 1;
41 }
42
43 /* decode the first frames to get the stream parameters. */
44 - av_find_stream_info(ffmovie_ctx->fmt_ctx);
45 + avformat_find_stream_info(ffmovie_ctx->fmt_ctx, NULL);
46
47 return 0;
48 }
49 @@ -416,7 +421,7 @@ static void _php_free_ffmpeg_movie(zend_rsrc_list_entry *rsrc TSRMLS_DC)
50 }
51 }
52
53 - av_close_input_file(ffmovie_ctx->fmt_ctx);
54 + avformat_close_input(&ffmovie_ctx->fmt_ctx);
55
56 efree(ffmovie_ctx);
57 }
58 @@ -440,7 +445,7 @@ static void _php_free_ffmpeg_pmovie(zend_rsrc_list_entry *rsrc TSRMLS_DC)
59 }
60 }
61
62 - av_close_input_file(ffmovie_ctx->fmt_ctx);
63 + avformat_close_input(&ffmovie_ctx->fmt_ctx);
64
65 free(ffmovie_ctx);
66 }
67 @@ -512,7 +517,7 @@ static AVCodecContext* _php_get_decoder_context(ff_movie_context *ffmovie_ctx,
68 GET_CODEC_PTR(ffmovie_ctx->fmt_ctx->streams[stream_index]->codec);
69
70 /* open the decoder */
71 - if (avcodec_open(ffmovie_ctx->codec_ctx[stream_index], decoder) < 0) {
72 + if (avcodec_open2(ffmovie_ctx->codec_ctx[stream_index], decoder, NULL) < 0) {
73 zend_error(E_WARNING, "Could not open codec for %s", _php_get_filename(ffmovie_ctx));
74 return NULL;
75 }
76 @@ -966,12 +967,14 @@ static const char* _php_get_codec_name(ff_movie_context *ffmovie_ctx, int type)
77 /* Copied from libavcodec/utils.c::avcodec_string */
78 if (p) {
79 codec_name = p->name;
80 +#ifdef FF_API_SUB_ID
81 if (decoder_ctx->codec_id == CODEC_ID_MP3) {
82 if (decoder_ctx->sub_id == 2)
83 codec_name = "mp2";
84 else if (decoder_ctx->sub_id == 1)
85 codec_name = "mp1";
86 }
87 +#endif
88 } else if (decoder_ctx->codec_id == CODEC_ID_MPEG2TS) {
89 /* fake mpeg2 transport stream codec (currently not registered) */
90 codec_name = "mpeg2ts";