View | Details | Raw Unified | Return to bug 214247 | Differences between
and this patch

Collapse All | Expand All

(-)b/multimedia/py-ffmpeg/Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	ffmpeg
4
PORTNAME=	ffmpeg
5
PORTVERSION=	1.2.4
5
PORTVERSION=	1.2.4
6
PORTREVISION=	2
6
PORTREVISION=	3
7
CATEGORIES=	multimedia python
7
CATEGORIES=	multimedia python
8
MASTER_SITES=	GH LOCAL/dbn/${PORTNAME}
8
MASTER_SITES=	GH LOCAL/dbn/${PORTNAME}
9
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
9
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
(-)b/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pxi (+29 lines)
Added Link Here
1
--- ffmpeg/_ffmpeg.pxi.orig	2013-10-28 16:04:02 UTC
2
+++ ffmpeg/_ffmpeg.pxi
3
@@ -53,8 +53,6 @@ cdef extern from "libavcodec/avcodec.h" 
4
         int channels
5
         AVCodec *codec
6
         AVMediaType codec_type
7
-        int (*get_buffer)(AVCodecContext *c, AVFrame *pic)
8
-        void (*release_buffer)(AVCodecContext *c, AVFrame *pic)
9
         AVRational time_base
10
         AVSampleFormat sample_fmt
11
     struct AVPicture:
12
@@ -83,7 +81,7 @@ cdef extern from "libavcodec/avcodec.h" 
13
     ctypedef int (*lockmgr_t)(void **mutex, AVLockOp op)
14
     int av_lockmgr_register(lockmgr_t cb)
15
 
16
-    AVFrame *avcodec_alloc_frame() 
17
+    AVFrame *av_frame_alloc() 
18
     int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
19
                          int *got_picture_ptr, AVPacket *avpkt)
20
     int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int
21
@@ -100,7 +98,7 @@ cdef extern from "libavcodec/avcodec.h" 
22
     int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)
23
     void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
24
 
25
-    void avcodec_get_frame_defaults(AVFrame *)
26
+    void av_frame_unref(AVFrame *)
27
 
28
 cdef extern from "libavresample/avresample.h" nogil:
29
     struct ResampleContext:
(-)b/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx (+63 lines)
Added Link Here
1
--- ffmpeg/_ffmpeg.pyx.orig	2013-10-28 16:04:02 UTC
2
+++ ffmpeg/_ffmpeg.pyx
3
@@ -518,11 +518,11 @@ cdef int audio_decode_frame(VideoState *
4
             got_frame = 0
5
 
6
             if frame == NULL:
7
-                frame = avcodec_alloc_frame()
8
+                frame = av_frame_alloc()
9
                 if frame == NULL:
10
                     return -1
11
             else:
12
-                avcodec_get_frame_defaults(frame)
13
+                av_frame_unref(frame)
14
 
15
             len1 = avcodec_decode_audio4(vs.audio_st.codec,
16
                     frame, &got_frame, pkt)
17
@@ -784,7 +784,7 @@ cdef void alloc_picture(void *userdata) 
18
 
19
     vp.ff_data_size = avpicture_get_size(PF_RGB24, vp.width, vp.height)
20
     vp.ff_data = <unsigned char *>av_malloc(vp.ff_data_size * sizeof(unsigned char))
21
-    vp.bmp = avcodec_alloc_frame()
22
+    vp.bmp = av_frame_alloc()
23
     avpicture_fill(<AVPicture *>vp.bmp, vp.ff_data, PF_RGB24,
24
             vp.width, vp.height)
25
 
26
@@ -886,19 +886,6 @@ cdef double synchronize_video(VideoState
27
     return pts
28
 
29
 
30
-cdef int our_get_buffer(AVCodecContext *c, AVFrame *pic) nogil:
31
-    cdef int ret = avcodec_default_get_buffer(c, pic)
32
-    cdef uint64_t *pts = <uint64_t*>av_malloc(sizeof(uint64_t))
33
-    memcpy(pts, &global_video_pkt_pts, sizeof(uint64_t))
34
-    pic.opaque = pts
35
-    return ret
36
-
37
-
38
-cdef void our_release_buffer(AVCodecContext *c, AVFrame *pic) nogil:
39
-    if pic != NULL: av_freep(&pic.opaque)
40
-    avcodec_default_release_buffer(c, pic)
41
-
42
-
43
 cdef int video_thread(void *arg) nogil:
44
     cdef VideoState *vs = <VideoState *>arg
45
     cdef AVPacket pkt1, *packet = &pkt1
46
@@ -906,7 +893,7 @@ cdef int video_thread(void *arg) nogil:
47
     cdef AVFrame *pFrame
48
     cdef double pts, ptst = 0
49
 
50
-    pFrame = avcodec_alloc_frame()
51
+    pFrame = av_frame_alloc()
52
 
53
     while True:
54
         if packet_queue_get(&vs.videoq, packet, 1) < 0:
55
@@ -1038,8 +1025,6 @@ cdef int stream_component_open(VideoStat
56
 
57
         packet_queue_init(&vs.videoq)
58
         vs.video_tid = SDL_CreateThread(video_thread, vs)
59
-        codecCtx.get_buffer = our_get_buffer
60
-        codecCtx.release_buffer = our_release_buffer
61
 
62
     else:
63
         pass

Return to bug 214247