multimedia/2mandvd: unbreak build with ffmpeg 3.x

videowrapper.cpp:107:40: error: use of undeclared identifier 'PIX_FMT_RGB24'; did you mean
      'AV_PIX_FMT_RGB24'?
                    pCodecCtx->height, PIX_FMT_RGB24, SWS_BICUBIC, NULL,
                                       ^~~~~~~~~~~~~
videowrapper.cpp:128:19: error: use of undeclared identifier 'avcodec_alloc_frame'
        pFrameRGB=avcodec_alloc_frame();
                  ^

PR:		207547
This commit is contained in:
Jan Beich 2016-11-04 07:21:57 +00:00
parent 9aa36d40ab
commit d5f961271e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=425292
2 changed files with 33 additions and 6 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= 2ManDVD
PORTVERSION= 1.8.5
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= multimedia
MASTER_SITES= http://download.tuxfamily.org/2mandvd/

View file

@ -1,7 +1,6 @@
diff -urN videowrapper.cpp videowrapper.cpp
--- videowrapper.cpp 2012-06-06 20:25:24.000000000 +1100
+++ videowrapper.cpp 2013-08-03 10:54:05.426228163 +1100
@@ -38,7 +38,7 @@
--- videowrapper.cpp.orig 2013-07-30 11:46:19 UTC
+++ videowrapper.cpp
@@ -38,7 +38,7 @@ void videowrapper::delete_videowrapper()
int videowrapper::load_video(QString filename)
{
// *** OUVERTURE DU FICHIER VIDEO ***
@ -10,7 +9,7 @@ diff -urN videowrapper.cpp videowrapper.cpp
if (avformat_open_input(&pFormatCtx,filename.toAscii().data(),NULL,NULL)!=0)
{
#else
@@ -91,7 +91,7 @@
@@ -91,7 +91,7 @@ int videowrapper::load_video(QString fil
// *** OUVERTURE DU CODEC ***
@ -19,3 +18,31 @@ diff -urN videowrapper.cpp videowrapper.cpp
if(avcodec_open(pCodecCtx, pCodec)<0)
{
#else
@@ -104,11 +104,11 @@ int videowrapper::load_video(QString fil
img_convert_ctx = sws_getContext(pCodecCtx->width,
pCodecCtx->height, pCodecCtx->pix_fmt, pCodecCtx->width,
- pCodecCtx->height, PIX_FMT_RGB24, SWS_BICUBIC, NULL,
+ pCodecCtx->height, AV_PIX_FMT_RGB24, SWS_BICUBIC, NULL,
NULL, NULL);
// *** ON DETERMINE LA TAILLE DU BUFFER ***
- numBytes=avpicture_get_size(PIX_FMT_RGB24, pCodecCtx->width,
+ numBytes=avpicture_get_size(AV_PIX_FMT_RGB24, pCodecCtx->width,
pCodecCtx->height);
buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
old_frame = -1;
@@ -125,10 +125,10 @@ QImage videowrapper::read_frame(int64_t
if ( num_frame != old_frame )
{
// *** ALLOCATE VIDEO FRAME ***
- pFrameRGB=avcodec_alloc_frame();
- pFrame=avcodec_alloc_frame();
+ pFrameRGB=av_frame_alloc();
+ pFrame=av_frame_alloc();
- avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,
+ avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_RGB24,
pCodecCtx->width, pCodecCtx->height);
av_seek_frame(pFormatCtx,videoStream,0, AVSEEK_FLAG_FRAME);
compte_frame = -1;