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=	3
6
PORTREVISION=	4
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 (-3 / +11 lines)
Lines 1-6 Link Here
1
--- ffmpeg/_ffmpeg.pxi.orig	2013-10-28 16:04:02 UTC
1
--- ffmpeg/_ffmpeg.pxi.orig	2013-10-28 16:04:02 UTC
2
+++ ffmpeg/_ffmpeg.pxi
2
+++ ffmpeg/_ffmpeg.pxi
3
@@ -53,8 +53,6 @@ cdef extern from "libavcodec/avcodec.h" 
3
@@ -35,6 +35,7 @@ cdef extern from "libavcodec/avcodec.h" 
4
         unsigned char **data
5
         int *linesize
6
         int64_t pts
7
+        int64_t pkt_pts;
8
         int repeat_pict
9
         int nb_samples
10
         int format
11
@@ -53,8 +54,6 @@ cdef extern from "libavcodec/avcodec.h" 
4
         int channels
12
         int channels
5
         AVCodec *codec
13
         AVCodec *codec
6
         AVMediaType codec_type
14
         AVMediaType codec_type
Lines 9-15 Link Here
9
         AVRational time_base
17
         AVRational time_base
10
         AVSampleFormat sample_fmt
18
         AVSampleFormat sample_fmt
11
     struct AVPicture:
19
     struct AVPicture:
12
@@ -83,7 +81,7 @@ cdef extern from "libavcodec/avcodec.h" 
20
@@ -83,7 +82,7 @@ cdef extern from "libavcodec/avcodec.h" 
13
     ctypedef int (*lockmgr_t)(void **mutex, AVLockOp op)
21
     ctypedef int (*lockmgr_t)(void **mutex, AVLockOp op)
14
     int av_lockmgr_register(lockmgr_t cb)
22
     int av_lockmgr_register(lockmgr_t cb)
15
 
23
 
Lines 18-24 Link Here
18
     int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
26
     int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
19
                          int *got_picture_ptr, AVPacket *avpkt)
27
                          int *got_picture_ptr, AVPacket *avpkt)
20
     int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int
28
     int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int
21
@@ -100,7 +98,7 @@ cdef extern from "libavcodec/avcodec.h" 
29
@@ -100,7 +99,7 @@ cdef extern from "libavcodec/avcodec.h" 
22
     int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)
30
     int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)
23
     void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
31
     void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
24
 
32
 
(-)b/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx (-5 / +34 lines)
Lines 1-6 Link Here
1
--- ffmpeg/_ffmpeg.pyx.orig	2013-10-28 16:04:02 UTC
1
--- ffmpeg/_ffmpeg.pyx.orig	2013-10-28 16:04:02 UTC
2
+++ ffmpeg/_ffmpeg.pyx
2
+++ ffmpeg/_ffmpeg.pyx
3
@@ -518,11 +518,11 @@ cdef int audio_decode_frame(VideoState *
3
@@ -81,8 +81,6 @@ DEF FF_REFRESH_EVENT                = 2
4
 DEF FF_QUIT_EVENT                   = 3
5
 DEF FF_SCHEDULE_EVENT               = 4
6
 
7
-cdef uint64_t global_video_pkt_pts = AV_NOPTS_VALUE
8
-
9
 ctypedef void (*event_callback_t)(void *)
10
 
11
 cdef struct Event:
12
@@ -518,11 +516,11 @@ cdef int audio_decode_frame(VideoState *
4
             got_frame = 0
13
             got_frame = 0
5
 
14
 
6
             if frame == NULL:
15
             if frame == NULL:
Lines 14-20 Link Here
14
 
23
 
15
             len1 = avcodec_decode_audio4(vs.audio_st.codec,
24
             len1 = avcodec_decode_audio4(vs.audio_st.codec,
16
                     frame, &got_frame, pkt)
25
                     frame, &got_frame, pkt)
17
@@ -784,7 +784,7 @@ cdef void alloc_picture(void *userdata) 
26
@@ -784,7 +782,7 @@ cdef void alloc_picture(void *userdata) 
18
 
27
 
19
     vp.ff_data_size = avpicture_get_size(PF_RGB24, vp.width, vp.height)
28
     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))
29
     vp.ff_data = <unsigned char *>av_malloc(vp.ff_data_size * sizeof(unsigned char))
Lines 23-29 Link Here
23
     avpicture_fill(<AVPicture *>vp.bmp, vp.ff_data, PF_RGB24,
32
     avpicture_fill(<AVPicture *>vp.bmp, vp.ff_data, PF_RGB24,
24
             vp.width, vp.height)
33
             vp.width, vp.height)
25
 
34
 
26
@@ -886,19 +886,6 @@ cdef double synchronize_video(VideoState
35
@@ -886,19 +884,6 @@ cdef double synchronize_video(VideoState
27
     return pts
36
     return pts
28
 
37
 
29
 
38
 
Lines 43-49 Link Here
43
 cdef int video_thread(void *arg) nogil:
52
 cdef int video_thread(void *arg) nogil:
44
     cdef VideoState *vs = <VideoState *>arg
53
     cdef VideoState *vs = <VideoState *>arg
45
     cdef AVPacket pkt1, *packet = &pkt1
54
     cdef AVPacket pkt1, *packet = &pkt1
46
@@ -906,7 +893,7 @@ cdef int video_thread(void *arg) nogil:
55
@@ -906,7 +891,7 @@ cdef int video_thread(void *arg) nogil:
47
     cdef AVFrame *pFrame
56
     cdef AVFrame *pFrame
48
     cdef double pts, ptst = 0
57
     cdef double pts, ptst = 0
49
 
58
 
Lines 52-58 Link Here
52
 
61
 
53
     while True:
62
     while True:
54
         if packet_queue_get(&vs.videoq, packet, 1) < 0:
63
         if packet_queue_get(&vs.videoq, packet, 1) < 0:
55
@@ -1038,8 +1025,6 @@ cdef int stream_component_open(VideoStat
64
@@ -919,16 +904,13 @@ cdef int video_thread(void *arg) nogil:
65
 
66
         pts = 0
67
 
68
-        # Save global pts to be stored in pFrame
69
-        global_video_pkt_pts = packet.pts
70
         # Decode video frame
71
         with gil:
72
             len1 = avcodec_decode_video2(
73
                     vs.video_st.codec, pFrame, &frameFinished, packet)
74
-        if packet.dts == AV_NOPTS_VALUE and pFrame.opaque:
75
-            memcpy(&ptst, pFrame.opaque, sizeof(uint64_t))
76
-            if ptst != AV_NOPTS_VALUE:
77
-                pts = ptst
78
+        if packet.dts == AV_NOPTS_VALUE:
79
+            if pFrame.pkt_pts != AV_NOPTS_VALUE:
80
+                pts = pFrame.pkt_pts
81
         elif packet.dts != AV_NOPTS_VALUE:
82
             pts = packet.dts
83
         else:
84
@@ -1038,8 +1020,6 @@ cdef int stream_component_open(VideoStat
56
 
85
 
57
         packet_queue_init(&vs.videoq)
86
         packet_queue_init(&vs.videoq)
58
         vs.video_tid = SDL_CreateThread(video_thread, vs)
87
         vs.video_tid = SDL_CreateThread(video_thread, vs)

Return to bug 214247