summaryrefslogtreecommitdiff
blob: fa8bdaf2cd4dfbd8d039498388441912dcf34e6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Index: hwdecode-demos-0.9.5/src/ffmpeg.c
===================================================================
--- hwdecode-demos-0.9.5.orig/src/ffmpeg.c
+++ hwdecode-demos-0.9.5/src/ffmpeg.c
@@ -193,10 +193,14 @@ int ffmpeg_decode(AVCodecContext *avctx,
 {
     CommonContext * const common = common_get_context();
     FFmpegContext * const ffmpeg = ffmpeg_get_context();
+    AVPacket pkt;
     int got_picture;
 
     got_picture = 0;
-    if (avcodec_decode_video(avctx, ffmpeg->frame, &got_picture, (uint8_t *)buf, buf_size) < 0)
+    av_init_packet( &pkt );
+    pkt.data = buf;
+    pkt.size = buf_size;
+    if (avcodec_decode_video2(avctx, ffmpeg->frame, &got_picture, &pkt) < 0)
         return -1;
 
     if (got_picture && hwaccel_type() == HWACCEL_NONE) {
Index: hwdecode-demos-0.9.5/src/ffmpeg_video.c
===================================================================
--- hwdecode-demos-0.9.5.orig/src/ffmpeg_video.c
+++ hwdecode-demos-0.9.5/src/ffmpeg_video.c
@@ -96,7 +96,7 @@ int decode(void)
 
     video_stream = NULL;
     for (i = 0; i < ic->nb_streams; i++) {
-        if (ic->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO && !video_stream)
+        if (ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO && !video_stream)
             video_stream = ic->streams[i];
         else
             ic->streams[i]->discard = AVDISCARD_ALL;