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 |