Un-break avidemux and plugins (import C++11 fixes from upstream)

PR:		224384
Submitted by:	rkoberman@gmail.com
MFH:		2018Q1
This commit is contained in:
Thomas Zander 2018-03-26 17:58:07 +00:00
parent 9dc8031281
commit f319259ca5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=465620
14 changed files with 249 additions and 2 deletions

View file

@ -12,8 +12,6 @@ COMMENT= Simple GUI based video editor (Plugins)
LIB_DEPENDS= libADM6avutil.so.54:multimedia/avidemux
BROKEN= fails to build
MASTERDIR= ${.CURDIR}/../avidemux
PLIST= ${.CURDIR}/pkg-plist

View file

@ -0,0 +1,53 @@
--- avidemux_plugins/ADM_demuxers/MpegTS/dmxTSPacket.cpp.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_demuxers/MpegTS/dmxTSPacket.cpp
@@ -144,7 +144,7 @@ bool tsPacket::setPos(uint64_t pos)
{
if(!_file->setpos(pos))
{
- printf("[tsPacket] Cannot seek to %"PRIx64"\n", pos);
+ printf("[tsPacket] Cannot seek to %" PRIx64"\n", pos);
return false;
}
return true;
@@ -387,7 +387,7 @@ nextPack3:
zprintf("[TS Demuxer] Code=0x%x pid=0x%x\n",code,pes->pid);
if((code&0xffffff00)!=0x100)
{
- printf("[Ts Demuxer] No PES startcode at 0x%"PRIx64"\n",pkt.startAt);
+ printf("[Ts Demuxer] No PES startcode at 0x%" PRIx64"\n",pkt.startAt);
printf("0x:%02x %02x %02x %02x\n",pkt.payload[4],pkt.payload[5],pkt.payload[6],pkt.payload[7]);
goto nextPack3;
}
@@ -433,7 +433,7 @@ nextPack3:
/**
\fn decodePesHeader
*/
-#define fail(x) {printf("[Ts Demuxer]*********"x"*******\n");return false;}
+#define fail(x) {printf("[Ts Demuxer]*********" x"*******\n");return false;}
bool tsPacket::decodePesHeader(TS_PESpacket *pes)
{
uint8_t *start=pes->payload+6;
@@ -735,7 +735,7 @@ bool tsPacketLinear::read(uint32_t le
*/
bool tsPacketLinear::getInfo(dmxPacketInfo *info)
{
-#warning FIXME
+//#warning FIXME
if(pesPacket->offset<4)
{
info->startAt=this->oldStartAt;
@@ -780,12 +780,12 @@ bool tsPacketLinear::seek(uint64_t pa
{
if(!_file->setpos(packetStart))
{
- printf("[tsPacket] Cannot seek to %"PRIx64"\n",packetStart);
+ printf("[tsPacket] Cannot seek to %" PRIx64"\n",packetStart);
return 0;
}
if(!refill())
{
- printf("[tsPacketLinear] Seek to %"PRIx64":%"PRIx32" failed\n",packetStart,offset);
+ printf("[tsPacketLinear] Seek to %" PRIx64":%" PRIx32" failed\n",packetStart,offset);
return false;
}
ADM_assert(offset<pesPacket->payloadSize);

View file

@ -0,0 +1,11 @@
--- avidemux_plugins/ADM_videoEncoder/ffDv/ADM_ffDv.cpp.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/ffDv/ADM_ffDv.cpp
@@ -44,7 +44,7 @@ typedef struct
static const dvProfileClass supportedProfiles[]=
{
- {720,480,29.97,dvColor422},
+ {720,480,30,dvColor422},
{720,576,25,dvColor420},
};

View file

@ -0,0 +1,14 @@
--- avidemux_plugins/ADM_videoEncoder/ffFlv1/ADM_ffFlv1.h.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/ffFlv1/ADM_ffFlv1.h
@@ -43,9 +43,9 @@
0, /* max_b_frames */ \
0, /* mpeg_quant */ \
1, /* is_luma_elim_threshold */ \
- -2, /* luma_elim_threshold */ \
+ 0, /* luma_elim_threshold */ \
1, /* is_chroma_elim_threshold */ \
- -5, /* chroma_elim_threshold */ \
+ 0, /* chroma_elim_threshold */ \
0.05, /*lumi_masking */ \
1, /* is lumi */ \
0.01, /*dark_masking */ \

View file

@ -0,0 +1,14 @@
--- avidemux_plugins/ADM_videoEncoder/ffMpeg2/ADM_ffMpeg2.h.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/ffMpeg2/ADM_ffMpeg2.h
@@ -53,9 +53,9 @@ enum
2, /* max_b_frames */ \
1, /* mpeg_quant */ \
1, /* is_luma_elim_threshold */ \
- -2, /* luma_elim_threshold */ \
+ 0, /* luma_elim_threshold */ \
1, /* is_chroma_elim_threshold */ \
- -5, /* chroma_elim_threshold */ \
+ 0, /* chroma_elim_threshold */ \
0.05, /*lumi_masking */ \
1, /* is lumi */ \
0.01, /*dark_masking */ \

View file

@ -0,0 +1,14 @@
--- avidemux_plugins/ADM_videoEncoder/ffMpeg4/ADM_ffMpeg4.h.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/ffMpeg4/ADM_ffMpeg4.h
@@ -43,9 +43,9 @@
2, /* max_b_frames */ \
0, /* mpeg_quant */ \
1, /* is_luma_elim_threshold */ \
- -2, /* luma_elim_threshold */ \
+ 0, /* luma_elim_threshold */ \
1, /* is_chroma_elim_threshold */ \
- -5, /* chroma_elim_threshold */ \
+ 0, /* chroma_elim_threshold */ \
0.05, /*lumi_masking */ \
1, /* is lumi */ \
0.01, /*dark_masking */ \

View file

@ -0,0 +1,34 @@
--- avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.cpp.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.cpp
@@ -173,7 +173,7 @@ again:
//return false;
}else
{
- //printf("[PPPP] x264 Incoming : %"PRIu64"us \n",image->Pts);
+ //printf("[PPPP] x264 Incoming : %" PRIu64"us \n",image->Pts);
// 2-preamble
if(false==preAmble(image))
{
@@ -289,11 +289,11 @@ bool x264Encoder::postAmble (ADMBitstrea
}
//------
aprintf("encoder delay=%d, pic out dts=%d picout pts=%d\n",getEncoderDelay(),picout->i_dts,picout->i_pts);
- aprintf("pts = %"PRIu64", dts=%"PRIu64", pts+delay=%"PRIu64" delta=%"PRIu64"\n",picout->i_pts,out->dts,out->pts,
+ aprintf("pts = %" PRIu64", dts=%" PRIu64", pts+delay=%" PRIu64" delta=%" PRIu64"\n",picout->i_pts,out->dts,out->pts,
out->pts-out->dts);
if(out->dts>out->pts)
{
- ADM_warning("DTS > PTS, that can happen when there are holes in the source (%"PRIu64"/%"PRIu64")\n",
+ ADM_warning("DTS > PTS, that can happen when there are holes in the source (%" PRIu64"/%" PRIu64")\n",
out->dts,out->pts);
if(picout->i_type!=X264_TYPE_B && picout->i_type!=X264_TYPE_BREF)
{
@@ -341,7 +341,7 @@ bool x264Encoder::postAmble (ADMBitstrea
ADM_error ("[x264] Unknown image type: %d\n", picout->i_type);
//ADM_assert(0);
}
- //printf("[OOOO] x264 Outgoing : %"PRIu64"us \n",out->dts);
+ //printf("[OOOO] x264 Outgoing : %" PRIu64"us \n",out->dts);
out->out_quantizer = picout->i_qpplus1;
return true;
}

View file

@ -0,0 +1,11 @@
--- avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.h.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.h
@@ -108,7 +108,7 @@ extern "C"
1.0, /* float rate_tolerance; */ \
0, /* uint32_t vbv_max_bitrate; */ \
0, /* uint32_t vbv_buffer_size; */ \
- 0.9, /* uint32_t vbv_buffer_init; */ \
+ 1, /* uint32_t vbv_buffer_init; */ \
1.4, /* float ip_factor; */ \
1.3, /* float pb_factor; */ \
1, /* uint32_t aq_mode; */ \

View file

@ -0,0 +1,11 @@
--- avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.cpp.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.cpp
@@ -38,7 +38,7 @@ typedef struct
}idcToken;
static const idcToken listOfIdc[]={
- {-1,"Auto"},
+ {(unsigned int)-1,"Auto"},
{10,"1"},
{11,"1.1"},
{12,"1.2"},

View file

@ -0,0 +1,16 @@
--- avidemux_plugins/ADM_videoEncoder/x265/ADM_x265.cpp.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/x265/ADM_x265.cpp
@@ -284,11 +284,11 @@ bool x265Encoder::postAmble (ADMBitstrea
}
//------
aprintf("encoder delay=%d, pic out dts=%d picout pts=%d\n",getEncoderDelay(),picout->i_dts,picout->i_pts);
- aprintf("pts = %"PRIu64", dts=%"PRIu64", pts+delay=%"PRIu64" delta=%"PRIu64"\n",picout->i_pts,out->dts,out->pts,
+ aprintf("pts = %" PRIu64", dts=%" PRIu64", pts+delay=%" PRIu64" delta=%" PRIu64"\n",picout->i_pts,out->dts,out->pts,
out->pts-out->dts);
if(out->dts>out->pts)
{
- ADM_warning("DTS > PTS, that can happen when there are holes in the source (%"PRIu64"/%"PRIu64")\n",
+ ADM_warning("DTS > PTS, that can happen when there are holes in the source (%" PRIu64"/%" PRIu64")\n",
out->dts,out->pts);
if(picout->sliceType!=X265_TYPE_B && picout->sliceType!=X265_TYPE_BREF)
{

View file

@ -0,0 +1,11 @@
--- avidemux_plugins/ADM_videoEncoder/x265/ADM_x265.h.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/x265/ADM_x265.h
@@ -85,7 +85,7 @@ extern "C"
1.0, /* float rate_tolerance; */ \
0, /* uint32_t vbv_max_bitrate; */ \
0, /* uint32_t vbv_buffer_size; */ \
- 0.9, /* uint32_t vbv_buffer_init; */ \
+ 1, /* uint32_t vbv_buffer_init; */ \
1.4, /* float ip_factor; */ \
1.3, /* float pb_factor; */ \
2, /* uint32_t aq_mode; */ \

View file

@ -0,0 +1,11 @@
--- avidemux_plugins/ADM_videoEncoder/x265/qt4/Q_x265.cpp.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/x265/qt4/Q_x265.cpp
@@ -38,7 +38,7 @@ typedef struct
}idcToken;
static const idcToken listOfIdc[]={
- {-1,"Auto"},
+ {(unsigned int)-1,"Auto"},
{10,"1"},
{20,"2"},
{21,"2.1"},

View file

@ -0,0 +1,20 @@
--- avidemux_plugins/ADM_videoEncoder/xvid4/ADM_xvid4.cpp.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoEncoder/xvid4/ADM_xvid4.cpp
@@ -54,7 +54,7 @@ typedef enum
RD_SQUARE = RD_HPEL_QPEL_8 | XVID_ME_EXTSEARCH_RD
} RateDistortionMode;
-uint32_t rdMode[5]=
+int32_t rdMode[5]=
{
RD_NONE,
RD_DCT_ME,
@@ -332,7 +332,7 @@ again:
// Store Pts/DTS
ADM_timeMapping map; // Store real PTS <->lav value mapping
map.realTS=image->Pts+getEncoderDelay();
- aprintf("Pushing fn=%d Time=%"PRIu64"\n",frameNum,map.realTS);
+ aprintf("Pushing fn=%d Time=%" PRIu64"\n",frameNum,map.realTS);
map.internalTS=frameNum++;
mapper.push_back(map);

View file

@ -0,0 +1,29 @@
--- avidemux_plugins/ADM_videoFilters6/telecide/Telecide_getFrame.cpp.orig 2016-01-29 08:47:25 UTC
+++ avidemux_plugins/ADM_videoFilters6/telecide/Telecide_getFrame.cpp
@@ -240,7 +240,7 @@ teleCide *_param=&configuration;
{
// The chosen frame doesn't match the prediction.
if (predicted_metric == 0) mismatch = 0.0;
- else mismatch = (100.0*abs(predicted_metric - lowest))/predicted_metric;
+ else mismatch = (100.0*abs((int)predicted_metric - (int)lowest))/predicted_metric;
if (mismatch < gthresh)
{
// It's close enough, so use the predicted one.
@@ -283,7 +283,7 @@ teleCide *_param=&configuration;
{
// The chosen frame doesn't match the prediction.
if (predicted_metric == 0) mismatch = 0.0;
- else mismatch = (100.0*abs(predicted_metric - lowest))/predicted_metric;
+ else mismatch = (100.0*abs((int)predicted_metric - (int)lowest))/predicted_metric;
if ((int) mismatch <= gthresh)
{
// It's close enough, so use the predicted one.
@@ -394,7 +394,7 @@ teleCide *_param=&configuration;
{
unsigned char *dstpp, *dstpn;
int v1, v2, z;
- #warning blend in place is wrong!
+ //#warning blend in place is wrong!
final=dst;
// MeanX:We should copy here as we blend from source and destination
// for the moment we do it in place, it is wrong.