packages: php-ffmpeg/php-ffmpeg-ffmpeg08.patch (NEW) - fixes build with new...

lisu lisu at pld-linux.org
Mon Jul 11 14:48:24 CEST 2011


Author: lisu                         Date: Mon Jul 11 12:48:24 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fixes build with newer ffmpeg

---- Files affected:
packages/php-ffmpeg:
   php-ffmpeg-ffmpeg08.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/php-ffmpeg/php-ffmpeg-ffmpeg08.patch
diff -u /dev/null packages/php-ffmpeg/php-ffmpeg-ffmpeg08.patch:1.1
--- /dev/null	Mon Jul 11 14:48:24 2011
+++ packages/php-ffmpeg/php-ffmpeg-ffmpeg08.patch	Mon Jul 11 14:48:18 2011
@@ -0,0 +1,196 @@
+--- ffmpeg-php-0.6.0/ffmpeg_movie.c.bak	2011-07-11 14:35:26.781123285 +0200
++++ ffmpeg-php-0.6.0/ffmpeg_movie.c	2011-07-11 14:36:58.333123285 +0200
+@@ -46,6 +46,10 @@
+ #include "ffmpeg_frame.h"
+ #include "ffmpeg_movie.h"
+ #include "ffmpeg_tools.h"
++
++#if LIBAVFORMAT_VERSION_MAJOR >= 53
++#define MAX_STREAMS 1024	/* arbitrary sanity check value */
++#endif
+    
+ #define GET_MOVIE_RESOURCE(ff_movie_ctx) {\
+     zval **_tmp_zval;\
+@@ -152,7 +156,7 @@
+  */
+ static AVStream *_php_get_video_stream(AVFormatContext *fmt_ctx)
+ {
+-    int i = _php_get_stream_index(fmt_ctx, CODEC_TYPE_VIDEO);
++    int i = _php_get_stream_index(fmt_ctx, AVMEDIA_TYPE_VIDEO);
+     
+     return i < 0 ? NULL : fmt_ctx->streams[i];
+ }
+@@ -165,7 +169,7 @@
+  */
+ static AVStream *_php_get_audio_stream(AVFormatContext *fmt_ctx)
+ {
+-    int i = _php_get_stream_index(fmt_ctx, CODEC_TYPE_AUDIO);
++    int i = _php_get_stream_index(fmt_ctx, AVMEDIA_TYPE_AUDIO);
+     
+     return i < 0 ? NULL : fmt_ctx->streams[i];
+ }
+@@ -508,7 +512,7 @@
+     stream_index = _php_get_stream_index(ffmovie_ctx->fmt_ctx, stream_type);
+     if (stream_index < 0) {
+         // FIXME: factor out the conditional.
+-        if (stream_type == CODEC_TYPE_VIDEO) {
++        if (stream_type == AVMEDIA_TYPE_VIDEO) {
+             zend_error(E_WARNING, "Can't find video stream in %s", 
+                     _php_get_filename(ffmovie_ctx));
+             return NULL;
+@@ -760,7 +764,7 @@
+     }
+ 
+ #if LIBAVCODEC_BUILD > 4753 
+-    if (GET_CODEC_FIELD(st->codec, codec_type) == CODEC_TYPE_VIDEO){
++    if (GET_CODEC_FIELD(st->codec, codec_type) == AVMEDIA_TYPE_VIDEO){
+         if (st->r_frame_rate.den && st->r_frame_rate.num) {
+             rate = av_q2d(st->r_frame_rate);
+         } else {
+@@ -892,7 +896,7 @@
+ {
+     AVCodecContext *decoder_ctx = NULL;
+ 
+-    decoder_ctx = _php_get_decoder_context(ffmovie_ctx, CODEC_TYPE_VIDEO);
++    decoder_ctx = _php_get_decoder_context(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+     if (!decoder_ctx) {
+         return 0;
+     }
+@@ -932,7 +936,7 @@
+ {
+     AVCodecContext *decoder_ctx;
+     
+-    decoder_ctx = _php_get_decoder_context(ffmovie_ctx, CODEC_TYPE_VIDEO);
++    decoder_ctx = _php_get_decoder_context(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+ 
+     return decoder_ctx ? decoder_ctx->pix_fmt : 0;
+ }
+@@ -1045,7 +1049,7 @@
+         codec_name = decoder_ctx->codec_name;
+     } else {
+         /* output avi tags */
+-        if (decoder_ctx->codec_type == CODEC_TYPE_VIDEO) {
++        if (decoder_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+             snprintf(buf1, sizeof(buf1), "%c%c%c%c",
+                     decoder_ctx->codec_tag & 0xff,
+                     (decoder_ctx->codec_tag >> 8) & 0xff,
+@@ -1071,7 +1075,7 @@
+ 
+     GET_MOVIE_RESOURCE(ffmovie_ctx);
+ 
+-    codec_name = (char*)_php_get_codec_name(ffmovie_ctx, CODEC_TYPE_VIDEO);
++    codec_name = (char*)_php_get_codec_name(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+  
+     if (codec_name) {
+         RETURN_STRINGL(codec_name, strlen(codec_name), 1);
+@@ -1091,7 +1095,7 @@
+ 
+     GET_MOVIE_RESOURCE(ffmovie_ctx);
+ 
+-    codec_name = (char*)_php_get_codec_name(ffmovie_ctx, CODEC_TYPE_AUDIO);
++    codec_name = (char*)_php_get_codec_name(ffmovie_ctx, AVMEDIA_TYPE_AUDIO);
+  
+     if (codec_name) {
+         RETURN_STRINGL(codec_name, strlen(codec_name), 1);
+@@ -1111,7 +1115,7 @@
+     
+     GET_MOVIE_RESOURCE(ffmovie_ctx);
+    
+-    stream_id= _php_get_stream_index(ffmovie_ctx->fmt_ctx, CODEC_TYPE_VIDEO); 
++    stream_id= _php_get_stream_index(ffmovie_ctx->fmt_ctx, AVMEDIA_TYPE_VIDEO); 
+ 
+ 	if( stream_id == -1 )
+ 	{
+@@ -1133,7 +1137,7 @@
+     
+     GET_MOVIE_RESOURCE(ffmovie_ctx);
+    
+-    stream_id= _php_get_stream_index(ffmovie_ctx->fmt_ctx, CODEC_TYPE_AUDIO); 
++    stream_id= _php_get_stream_index(ffmovie_ctx->fmt_ctx, AVMEDIA_TYPE_AUDIO); 
+ 
+ 	if( stream_id == -1 )
+ 	{
+@@ -1171,7 +1175,7 @@
+ 
+     GET_MOVIE_RESOURCE(ffmovie_ctx);
+ 
+-    channels = _php_get_codec_channels(ffmovie_ctx, CODEC_TYPE_AUDIO);
++    channels = _php_get_codec_channels(ffmovie_ctx, AVMEDIA_TYPE_AUDIO);
+  
+     if (channels) {
+         RETURN_LONG(channels);
+@@ -1207,7 +1211,7 @@
+ 
+     GET_MOVIE_RESOURCE(ffmovie_ctx);
+ 
+-    sample_rate = _php_get_codec_sample_rate(ffmovie_ctx, CODEC_TYPE_AUDIO);
++    sample_rate = _php_get_codec_sample_rate(ffmovie_ctx, AVMEDIA_TYPE_AUDIO);
+  
+     if (sample_rate) {
+         RETURN_LONG(sample_rate);
+@@ -1243,7 +1247,7 @@
+ 
+     GET_MOVIE_RESOURCE(ffmovie_ctx);
+ 
+-    bit_rate = _php_get_codec_bit_rate(ffmovie_ctx, CODEC_TYPE_AUDIO);
++    bit_rate = _php_get_codec_bit_rate(ffmovie_ctx, AVMEDIA_TYPE_AUDIO);
+  
+     if (bit_rate) {
+         RETURN_LONG(bit_rate);
+@@ -1263,7 +1267,7 @@
+ 
+     GET_MOVIE_RESOURCE(ffmovie_ctx);
+ 
+-    bit_rate = _php_get_codec_bit_rate(ffmovie_ctx, CODEC_TYPE_VIDEO);
++    bit_rate = _php_get_codec_bit_rate(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+  
+     if (bit_rate) {
+         RETURN_LONG(bit_rate);
+@@ -1286,7 +1290,7 @@
+     int got_frame; 
+ 
+     video_stream = _php_get_stream_index(ffmovie_ctx->fmt_ctx, 
+-            CODEC_TYPE_VIDEO);
++            AVMEDIA_TYPE_VIDEO);
+     if (video_stream < 0) {
+         return NULL;
+     }
+@@ -1300,7 +1304,7 @@
+             avcodec_decode_video2(decoder_ctx, frame, &got_frame, &packet);
+         
+             if (got_frame) {
+-                *is_keyframe = (packet.flags & PKT_FLAG_KEY);
++                *is_keyframe = (packet.flags & AV_PKT_FLAG_KEY);
+                 *pts = packet.pts;
+                 av_free_packet(&packet);
+                 return frame;
+@@ -1327,7 +1331,7 @@
+     AVCodecContext *decoder_ctx = NULL;
+     AVFrame *frame = NULL;
+ 
+-    decoder_ctx = _php_get_decoder_context(ffmovie_ctx, CODEC_TYPE_VIDEO);
++    decoder_ctx = _php_get_decoder_context(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+     if (decoder_ctx == NULL) {
+         return NULL;
+     }
+@@ -1363,9 +1367,9 @@
+                 wanted_frame != GETFRAME_NEXTFRAME &&
+                 wanted_frame - ffmovie_ctx->frame_number > 
+                 decoder_ctx->gop_size + 1) {
+-            decoder_ctx->hurry_up = 1;
++            decoder_ctx->skip_frame = AVDISCARD_NONREF;
+         } else {
+-            decoder_ctx->hurry_up = 0;
++            decoder_ctx->skip_frame = AVDISCARD_DEFAULT;
+         }
+         ffmovie_ctx->frame_number++; 
+ 
+@@ -1524,7 +1528,7 @@
+     AVCodecContext *decoder_ctx;
+ 	
+ 
+-    decoder_ctx = _php_get_decoder_context(ffmovie_ctx, CODEC_TYPE_VIDEO);
++    decoder_ctx = _php_get_decoder_context(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+     if (!decoder_ctx) {
+         return -1;
+     }
================================================================


More information about the pld-cvs-commit mailing list