Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
*
*/

#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>

#include "element.h"
#include "mpg_common.h"
Expand All @@ -43,7 +43,7 @@ unsigned int bitrates[3][16] =

uint32_t freq[4] = {441, 480, 320, 0};
static uint64_t samples[4] = { 384, 1152, 1152, 1536};
const char *frames[3] = {"I-Frame","P-Frame","B-Frame"};
//const char *frames[3] = {"I-Frame","P-Frame","B-Frame"};

unsigned int ac3_bitrates[32] =
{32,40,48,56,64,80,96,112,128,160,192,224,256,320,384,448,512,576,640,
Expand All @@ -67,7 +67,8 @@ void fix_audio_count(uint64_t *acount, audio_frame_t *aframe, uint64_t origpts,
uint64_t di = (samples [3-aframe->layer] * 27000000ULL);
int64_t diff = ptsdiff(origpts,pts);
int c=(aframe->frequency * diff+di/2)/di;
if (c) LOG(VB_GENERAL, LOG_INFO, "fix audio frames %d", c);
if (c)
LOG(VB_GENERAL, LOG_INFO, QString("fix audio frames %1").arg(c));
*acount += c;
}

Expand All @@ -85,8 +86,8 @@ uint64_t next_ptsdts_video(uint64_t *pts, sequence_t *s, uint64_t fcount, uint64
} else {
uint64_t extra_time = 0;
#if 0
LOG(VB_GENERAL, LOG_INFO, "pulldown %d %d",
(int)fcount-1, fnum-1);
LOG(VB_GENERAL, LOG_INFO, QString("pulldown %1 %2")
.arg(fcount-1).arg(fnum-1));
#endif

if ( s->pulldown == PULLDOWN32)
Expand Down Expand Up @@ -144,7 +145,9 @@ void fix_video_count(sequence_t *s, uint64_t *frame, uint64_t origpts, uint64_t
if (!dsig) fr -= (int)dframe;
else fr += (int)dframe;
*frame = *frame + fr/2;
if (fr/2) LOG(VB_GENERAL, LOG_INFO, "fixed video frame %d", (int)fr/2);
if (fr/2)
LOG(VB_GENERAL, LOG_INFO,
QString("fixed video frame %1").arg(fr/2));
}


Expand Down Expand Up @@ -175,10 +178,10 @@ void pts2time(uint64_t pts, uint8_t *buf, int len)
#if 0
c+=4;
LOG(VB_GENERAL, LOG_INFO, "fixed time");
LOG(VB_GENERAL, LOG_INFO, "%02d:%02d:%02d",
(int)((buf[c]>>2)& 0x1F),
(int)(((buf[c]<<4)& 0x30)|((buf[c+1]>>4)& 0x0F)),
(int)(((buf[c+1]<<3)& 0x38)|((buf[c+2]>>5)& 0x07)));
LOG(VB_GENERAL, LOG_INFO, QString("%1:%2:%3")
.arg((int)((buf[c]>>2)& 0x1F), 2,10,QChar('0'))
.arg((int)(((buf[c]<<4)& 0x30)|((buf[c+1]>>4)& 0x0F)), 2,10,QChar('0'))
.arg((int)(((buf[c+1]<<3)& 0x38)|((buf[c+2]>>5)& 0x07)), 2,10,QChar('0')));
#endif
c = len;

Expand Down Expand Up @@ -242,8 +245,8 @@ int get_video_info(ringbuffer *rbuf, sequence_t *s, int off, int le)
}

if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " size = %dx%d",
s->h_size, s->v_size);
LOG(VB_GENERAL, LOG_DEBUG,
QString(" size = %1x%2").arg(s->h_size).arg(s->v_size));

sw = (int)(headr[3]&0x0F);

Expand Down Expand Up @@ -278,16 +281,16 @@ int get_video_info(ringbuffer *rbuf, sequence_t *s, int off, int le)
break;
}
if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " frame rate: %2.3f fps",
s->frame_rate/1000.0);
LOG(VB_GENERAL, LOG_DEBUG, QString(" frame rate: %1 fps")
.arg(s->frame_rate/1000.0, 2,'f',3,QChar('0')));

s->bit_rate = (((headr[4] << 10) & 0x0003FC00UL)
| ((headr[5] << 2) & 0x000003FCUL) |
(((headr[6] & 0xC0) >> 6) & 0x00000003UL));

if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " bit rate: %.2f Mbit/s",
400*(s->bit_rate)/1000000.0);
LOG(VB_GENERAL, LOG_DEBUG, QString(" bit rate: %1 Mbit/s")
.arg(400*(s->bit_rate)/1000000.0, 0,'f',2,QChar('0')));

s->video_format = form;

Expand All @@ -296,8 +299,8 @@ int get_video_info(ringbuffer *rbuf, sequence_t *s, int off, int le)
s->vbv_buffer_size = (( headr[7] & 0xF8) >> 3 ) | (( headr[6] & 0x1F )<< 5);
s->flags = ( headr[7] & 0x06);
if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " vbvbuffer %d",
16*1024*(s->vbv_buffer_size));
LOG(VB_GENERAL, LOG_DEBUG, QString(" vbvbuffer %1")
.arg(16*1024*(s->vbv_buffer_size)));

c += 8;
if ( !(s->flags & INTRAQ_FLAG) )
Expand Down Expand Up @@ -490,8 +493,8 @@ int get_audio_info(ringbuffer *rbuf, audio_frame_t *af, int off, int le)
af->layer = (headr[1] & 0x06) >> 1;

if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, "Audiostream: layer: %d",
4-af->layer);
LOG(VB_GENERAL, LOG_DEBUG, QString("Audiostream: layer: %1")
.arg(4-af->layer));


af->bit_rate = bitrates[(3-af->layer)][(headr[2] >> 4 )]*1000;
Expand All @@ -502,8 +505,8 @@ int get_audio_info(ringbuffer *rbuf, audio_frame_t *af, int off, int le)
else if (af->bit_rate == 0xf)
LOG(VB_GENERAL, LOG_DEBUG, " BRate: reserved");
else
LOG(VB_GENERAL, LOG_DEBUG, " BRate: %d kb/s",
af->bit_rate/1000);
LOG(VB_GENERAL, LOG_DEBUG, QString(" BRate: %1 kb/s")
.arg(af->bit_rate/1000));
}

fr = (headr[2] & 0x0c ) >> 2;
Expand All @@ -513,15 +516,15 @@ int get_audio_info(ringbuffer *rbuf, audio_frame_t *af, int off, int le)
if (af->frequency == 3)
LOG(VB_GENERAL, LOG_DEBUG, " Freq: reserved");
else
LOG(VB_GENERAL, LOG_DEBUG, " Freq: %2.1f kHz",
af->frequency/1000.0);
LOG(VB_GENERAL, LOG_DEBUG, QString(" Freq: %1 kHz")
.arg(af->frequency/1000.0, 2,'f',1,QChar('0')));
}
af->off = c;
af->set = 1;

af->frametime = ((samples [3-af->layer] * 27000000ULL) / af->frequency);
af->framesize = af->bit_rate *slots [3-af->layer]/ af->frequency;
LOG(VB_GENERAL, LOG_INFO, " frame size: %d", af->framesize);
LOG(VB_GENERAL, LOG_INFO, QString(" frame size: %1").arg(af->framesize));
printpts(af->frametime);

return c;
Expand All @@ -547,13 +550,14 @@ int get_ac3_info(ringbuffer *rbuf, audio_frame_t *af, int off, int le)
af->bit_rate = ac3_bitrates[frame>>1]*1000;
int half = ac3half[headr[5] >> 3];
if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " bit rate: %d kb/s",
af->bit_rate/1000);
LOG(VB_GENERAL, LOG_DEBUG, QString(" bit rate: %1 kb/s")
.arg(af->bit_rate/1000));
int fr = (headr[4] & 0xc0) >> 6;
af->frequency = (ac3_freq[fr] *100) >> half;

if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " freq: %d Hz", af->frequency);
LOG(VB_GENERAL, LOG_DEBUG,
QString(" freq: %1 Hz").arg(af->frequency));

switch (headr[4] & 0xc0) {
case 0:
Expand All @@ -570,7 +574,8 @@ int get_ac3_info(ringbuffer *rbuf, audio_frame_t *af, int off, int le)
}

if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " frame size %d", af->framesize);
LOG(VB_GENERAL, LOG_DEBUG,
QString(" frame size %1").arg(af->framesize));

af->off = c;
af->set = 1;
Expand Down Expand Up @@ -631,29 +636,29 @@ int get_video_ext_info(ringbuffer *rbuf, sequence_t *s, int off, int le)
s->h_size |= hsize;
s->v_size |= vsize;
if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " size = %dx%d",
s->h_size, s->v_size);
LOG(VB_GENERAL, LOG_DEBUG, QString(" size = %1x%2")
.arg(s->h_size).arg(s->v_size));

uint32_t bitrate = ((headr[2]& 0x1F) << 25) | (( headr[3] & 0xFE ) << 17);
s->bit_rate |= bitrate;

if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " bit rate: %.2f Mbit/s",
400.0*(s->bit_rate)/1000000.0);
LOG(VB_GENERAL, LOG_DEBUG, QString(" bit rate: %1 Mbit/s")
.arg(400.0*(s->bit_rate)/1000000.0, 0,'f',2,QChar('0')));


uint32_t vbvb = (headr[4]<<10);
s->vbv_buffer_size |= vbvb;
if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " vbvbuffer %d",
16*1024*(s->vbv_buffer_size));
LOG(VB_GENERAL, LOG_DEBUG, QString(" vbvbuffer %1")
.arg(16*1024*(s->vbv_buffer_size)));
uint8_t fr_n = (headr[5] & 0x60) >> 6;
uint8_t fr_d = (headr[5] & 0x1F);

s->frame_rate = s->frame_rate * (fr_n+1) / (fr_d+1);
if (DEBUG)
LOG(VB_GENERAL, LOG_DEBUG, " frame rate: %2.3f",
s->frame_rate/1000.0);
LOG(VB_GENERAL, LOG_DEBUG, QString(" frame rate: %1")
.arg(s->frame_rate/1000.0, 2,'f',3,QChar('0')));
s->ext_set=1;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions mythtv/programs/mythtranscode/external/replex/element.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#ifndef _ELEMENT_H_
#define _ELEMENT_H_

#include <stdint.h>
#include <cstdint>

#include "ringbuffer.h"

Expand Down Expand Up @@ -74,8 +74,8 @@ enum { VIDEO_NONE=0, VIDEO_PAL, VIDEO_NTSC};
#define PULLDOWN32 1
#define PULLDOWN23 2

#define CLOCK_MS 27000ULL
#define CLOCK_PER 27000000000ULL
#define CLOCK_MS 27000LL
#define CLOCK_PER 27000000000LL
#define SEC_PER (CLOCK_PER/s->frame_rate)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
*
*/

#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>
#include "element.h"
#include "pes.h"
#include "ts.h"
Expand All @@ -36,40 +36,40 @@

void show_buf(uint8_t *buf, int length)
{
uint8_t buffer[100];
uint8_t temp[8];
char buffer[100];
char temp[8];
buffer[0] = '\0';

for (int i=0; i<length; i+=16){
int j = 0;
for (j=0; j < 8 && j+i<length; j++)
{
sprintf(temp,"0x%02x ", (int)(buf[i+j]));
strcat(buffer, temp);
std::sprintf(temp,"0x%02x ", (int)(buf[i+j]));
std::strcat(buffer, temp);
}
for (int r=j; r<8; r++)
strcat(buffer, " ");
std::strcat(buffer, " ");

strcat(buffer, " ");
std::strcat(buffer, " ");

for (j=8; j < 16 && j+i<length; j++)
{
sprintf(temp, "0x%02x ", (int)(buf[i+j]));
strcat(buffer, temp);
std::sprintf(temp, "0x%02x ", (int)(buf[i+j]));
std::strcat(buffer, temp);
}
for (int r=j; r<16; r++)
strcat(buffer, " ");
std::strcat(buffer, " ");

for (j=0; j < 16 && j+i<length; j++){
switch(buf[i+j]){
case '0'...'Z':
case 'a'...'z':
sprintf(temp, "%c", buf[i+j]);
std::sprintf(temp, "%c", buf[i+j]);
break;
default:
sprintf(temp, ".");
std::sprintf(temp, ".");
}
strcat(buffer, temp);
std::strcat(buffer, temp);
}
LOG(VB_GENERAL, LOG_INFO, buffer);
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythtranscode/external/replex/mpg_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#ifndef _MPG_COMMON_H_
#define _MPG_COMMON_H_

#include <stdint.h>
#include <cstdint>
#include "ringbuffer.h"


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <cstdlib>
#include <cstring>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>

#include "multiplex.h"
#include "ts.h"
Expand Down Expand Up @@ -62,9 +62,9 @@ static int peek_next_video_unit(multiplex_t *mx, index_unit *viu)
ring_peek(mx->index_vrbuffer, (uint8_t *)viu, sizeof(index_unit),0);
#ifdef OUT_DEBUG
LOG(VB_GENERAL, LOG_DEBUG,
"video index start: %d stop: %d (%d) rpos: %d\n",
viu->start, (viu->start+viu->length),
viu->length, ring_rpos(mx->vrbuffer));
QString("video index start: %1 stop: %2 (%3) rpos: %4\n")
.arg(viu->start).arg(viu->start+viu->length)
.arg(viu->length).arg(ring_rpos(mx->vrbuffer)));
#endif

return 1;
Expand All @@ -86,9 +86,9 @@ static int get_next_video_unit(multiplex_t *mx, index_unit *viu)
ring_read(mx->index_vrbuffer, (uint8_t *)viu, sizeof(index_unit));
#ifdef OUT_DEBUG
LOG(VB_GENERAL, LOG_INFO,
"video index start: %d stop: %d (%d) rpos: %d\n",
viu->start, (viu->start+viu->length),
viu->length, ring_rpos(mx->vrbuffer));
QString("video index start: %1 stop: %2 (%3) rpos: %4\n")
.arg(viu->start).arg(viu->start+viu->length)
.arg(viu->length).arg(ring_rpos(mx->vrbuffer)));
#endif
if(! peek_next_video_unit(mx, &nviu))
return 1;
Expand All @@ -113,9 +113,9 @@ static int peek_next_ext_unit(multiplex_t *mx, index_unit *extiu, int i)
sizeof(index_unit),0);
#ifdef OUT_DEBUG
LOG(VB_GENERAL, LOG_DEBUG,
"ext index start: %d stop: %d (%d) rpos: %d",
extiu->start, (extiu->start+extiu->length),
extiu->length, ring_rpos(mx->extrbuffer));
QString("ext index start: %1 stop: %2 (%3) rpos: %4")
.arg(extiu->start).arg(extiu->start+extiu->length)
.arg(extiu->length).arg(ring_rpos(mx->extrbuffer)));
#endif

return 1;
Expand Down Expand Up @@ -155,9 +155,9 @@ static int get_next_ext_unit(multiplex_t *mx, index_unit *extiu, int i)

#ifdef OUT_DEBUG
LOG(VB_GENERAL, LOG_DEBUG,
"ext index start: %d stop: %d (%d) rpos: %d",
extiu->start, (extiu->start+extiu->length),
extiu->length, ring_rpos(&mx->extrbuffer[i]));
QString("ext index start: %1 stop: %2 (%3) rpos: %4")
.arg(extiu->start).arg(extiu->start+extiu->length)
.arg(extiu->length).arg(ring_rpos(&mx->extrbuffer[i])));
#endif
return 1;
}
Expand Down Expand Up @@ -259,10 +259,10 @@ static void writeout_video(multiplex_t *mx)
mx->SCR + 500*CLOCK_MS);
#ifdef OUT_DEBUG1
LOG(VB_GENERAL, LOG_DEBUG,
"EXTRACLOCK2: %lli %lli %lli",
viu->dts, mx->video_delay, mx->SCR);
LOG(VB_GENERAL, LOG_DEBUG, "EXTRACLOCK2: %lli",
mx->extra_clock);
QString("EXTRACLOCK2: %1 %2 %3")
.arg(viu->dts).arg(mx->video_delay).arg(mx->SCR));
LOG(VB_GENERAL, LOG_DEBUG, QString("EXTRACLOCK2: %1")
.arg(mx->extra_clock));
printpts(mx->extra_clock);
#endif

Expand Down Expand Up @@ -335,13 +335,13 @@ static void writeout_ext(multiplex_t *mx, int n)

case MPEG_AUDIO:
#ifdef OUT_DEBUG
LOG(VB_GENERAL, LOG_DEBUG, "writing AUDIO%d pack\n", n);
LOG(VB_GENERAL, LOG_DEBUG, QString("writing AUDIO%1 pack\n").arg(n));
#endif
break;

case AC3:
#ifdef OUT_DEBUG
LOG(VB_GENERAL, LOG_DEBUG, "writing AC3%d pack\n", n);
LOG(VB_GENERAL, LOG_DEBUG, QString("writing AC3%1 pack\n").arg(n));
#endif
rest_data = 1; // 4 bytes AC3 header
break;
Expand All @@ -364,9 +364,9 @@ static void writeout_ext(multiplex_t *mx, int n)
dummy_add(dbuf, pts, aiu->length);

#ifdef OUT_DEBUG
LOG(VB_GENERAL, LOG_DEBUG, "start: %d stop: %d (%d) length %d",
aiu->start, (aiu->start+aiu->length),
aiu->length, length);
LOG(VB_GENERAL, LOG_DEBUG, QString("start: %1 stop: %2 (%3) length %4")
.arg(aiu->start).arg(aiu->start+aiu->length)
.arg(aiu->length).arg(length));
printpts(*apts);
printpts(aiu->pts);
printpts(mx->audio_delay);
Expand All @@ -390,9 +390,9 @@ static void writeout_ext(multiplex_t *mx, int n)
nframes++;
#ifdef OUT_DEBUG
LOG(VB_GENERAL, LOG_DEBUG,
"start: %d stop: %d (%d) length %d",
aiu->start, (aiu->start+aiu->length),
aiu->length, length);
QString("start: %1 stop: %2 (%3) length %4")
.arg(aiu->start).arg(aiu->start+aiu->length)
.arg(aiu->length).arg(length));
printpts(*apts);
printpts(aiu->pts);
printpts(mx->audio_delay);
Expand Down Expand Up @@ -502,7 +502,8 @@ void check_times( multiplex_t *mx, int *video_ok, int *ext_ok, int *start)

if (mx->VBR) {
#ifdef OUT_DEBUG1
LOG(VB_GENERAL, LOG_DEBUG, "EXTRACLOCK: %lli", mx->extra_clock);
LOG(VB_GENERAL, LOG_DEBUG,
QString("EXTRACLOCK: %1").arg(mx->extra_clock));
printpts(mx->extra_clock);
#endif

Expand Down Expand Up @@ -564,13 +565,17 @@ void check_times( multiplex_t *mx, int *video_ok, int *ext_ok, int *start)
printpts(mx->oldSCR);
LOG(VB_GENERAL, LOG_DEBUG, "VDTS");
printpts(mx->viu.dts);
LOG(VB_GENERAL, LOG_DEBUG, " (%d) EXT", *video_ok);
for (i = 0; i < mx->extcnt; i++){
LOG(VB_GENERAL, LOG_DEBUG, "%d:", mx->ext[i].type);
LOG(VB_GENERAL, LOG_DEBUG, QString(" (%1) EXT").arg(*video_ok));
for (int i = 0; i < mx->extcnt; i++){
LOG(VB_GENERAL, LOG_DEBUG,
QString("%1:").arg(mx->ext[i].type));
printpts(mx->ext[i].pts);
LOG(VB_GENERAL, LOG_DEBUG, " (%d)", ext_ok[i]);
LOG(VB_GENERAL, LOG_DEBUG,
QString(" (%1)").arg(ext_ok[i]));
}
}
#else
(void)set_ok;
#endif
}
void write_out_packs( multiplex_t *mx, int video_ok, int *ext_ok)
Expand Down Expand Up @@ -775,8 +780,8 @@ void init_multiplex( multiplex_t *mx, sequence_t *seq_head,
for (mx->extcnt = 0, data_rate = 0, i = 0;
i < N_AUDIO && exttype[i]; i++){
if (exttype[i] >= MAX_TYPES) {
LOG(VB_GENERAL, LOG_ERR, "Found illegal stream type %d",
exttype[i]);
LOG(VB_GENERAL, LOG_ERR,
QString("Found illegal stream type %1").arg(exttype[i]));
exit(1);
}
mx->ext[i].type = exttype[i];
Expand Down Expand Up @@ -822,8 +827,8 @@ void init_multiplex( multiplex_t *mx, sequence_t *seq_head,
"data rate may be to high for required mux rate");
mx->muxr = mx->mux_rate;
}
LOG(VB_GENERAL, LOG_INFO, "Mux rate: %.2f Mbit/s",
mx->muxr*8.0/1000000.0);
LOG(VB_GENERAL, LOG_INFO, QString("Mux rate: %1 Mbit/s")
.arg(mx->muxr*8.0/1000000.0, 0,'f',2,QChar('0')));

mx->SCRinc = 27000000ULL/((uint64_t)mx->muxr /
(uint64_t) mx->pack_size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
*
*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#ifdef _WIN32
#include <winsock2.h>
Expand All @@ -48,12 +48,12 @@ void printpts(int64_t pts)
}
pts = pts/300;
pts &= (MAX_PTS-1);
LOG(VB_GENERAL, LOG_INFO, "%s%2d:%02d:%02d.%04d",
(negative ? "-" : ""),
(unsigned int)(pts/90000.0)/3600,
((unsigned int)(pts/90000.0)%3600)/60,
((unsigned int)(pts/90000.0)%3600)%60,
(((unsigned int)(pts/9.0)%36000000)%600000)%10000);
LOG(VB_GENERAL, LOG_INFO, QString("%1%2:%3:%4.%5")
.arg(negative ? "-" : "")
.arg((unsigned int)(pts/90000.0)/3600, 2,10,QChar('0'))
.arg(((unsigned int)(pts/90000.0)%3600)/60, 2,10,QChar('0'))
.arg(((unsigned int)(pts/90000.0)%3600)%60, 2,10,QChar('0'))
.arg((((unsigned int)(pts/9.0)%36000000)%600000)%10000, 4,10,QChar('0')));
}

void printptss(int64_t pts)
Expand All @@ -65,13 +65,12 @@ void printptss(int64_t pts)
}
pts = pts/300;
pts &= (MAX_PTS-1);
LOG(VB_GENERAL, LOG_INFO, "%s%2d:%02d:%02d.%03d",
(negative ? "-" : ""),
(unsigned int)(pts/90000.0)/3600,
((unsigned int)(pts/90000.0)%3600)/60,
((unsigned int)(pts/90000.0)%3600)%60,
(((unsigned int)(pts/90.0)%3600000)%60000)%1000
);
LOG(VB_GENERAL, LOG_INFO, QString("%1%2:%3:%4.%5")
.arg(negative ? "-" : "")
.arg((unsigned int)(pts/90000.0)/3600, 2,10,QChar('0'))
.arg(((unsigned int)(pts/90000.0)%3600)/60, 2,10,QChar('0'))
.arg(((unsigned int)(pts/90000.0)%3600)%60, 2,10,QChar('0'))
.arg((((unsigned int)(pts/90.0)%3600000)%60000)%1000, 3,10,QChar('0')));
}

/* use if you know that ptss are close and may overflow */
Expand Down Expand Up @@ -128,7 +127,8 @@ int ptscmp(uint64_t pts1, uint64_t pts2)
ret = -2;
}
#if 0
LOG(VB_GENERAL, LOG_INFO, "PTSCMP: %lli %lli %d\n", pts1, pts2, ret);
LOG(VB_GENERAL, LOG_INFO,
QString("PTSCMP: %1 %2 %3\n").arg(pts1).arg(pts2).arg(ret));
printpts(pts1);
printpts(pts2);
#endif
Expand All @@ -150,7 +150,7 @@ void init_pes_in(pes_in_t *p, int t, ringbuffer *rb, int wi){
p->withbuf = wi;

if (p->withbuf && !p->buf){
p->buf = malloc(MAX_PLENGTH*sizeof(uint8_t));
p->buf = static_cast<uchar*>(malloc(MAX_PLENGTH*sizeof(uint8_t)));
memset(p->buf,0,MAX_PLENGTH*sizeof(uint8_t));
} else if (rb) p->rbuf = rb;
if (p->rbuf) p->ini_pos = ring_wpos(p->rbuf);
Expand All @@ -162,7 +162,7 @@ void init_pes_in(pes_in_t *p, int t, ringbuffer *rb, int wi){

void get_pes (pes_in_t *p, uint8_t *buf, int count, void (*func)(pes_in_t *p))
{
unsigned short *pl = NULL;
unsigned short *pl = nullptr;
int done = 1;

uint8_t headr[3] = { 0x00, 0x00, 0x01} ;
Expand Down Expand Up @@ -198,6 +198,7 @@ void get_pes (pes_in_t *p, uint8_t *buf, int count, void (*func)(pes_in_t *p))
case DSM_CC_STREAM :
case ISO13522_STREAM:
p->done = 1;
[[clang::fallthrough]];
case PRIVATE_STREAM1:
case VIDEO_STREAM_S ... VIDEO_STREAM_E:
case AUDIO_STREAM_S ... AUDIO_STREAM_E:
Expand Down Expand Up @@ -352,8 +353,8 @@ void get_pes (pes_in_t *p, uint8_t *buf, int count, void (*func)(pes_in_t *p))
} else {
if (ring_write(p->rbuf, buf+c, l)<0){
LOG(VB_GENERAL, LOG_ERR,
"ring buffer overflow %d",
p->rbuf->size);
QString("ring buffer overflow %1")
.arg(p->rbuf->size));
exit(1);
}
}
Expand All @@ -379,7 +380,7 @@ void get_pes (pes_in_t *p, uint8_t *buf, int count, void (*func)(pes_in_t *p))
}

if (p->plength && p->found == p->plength+6) {
init_pes_in(p, p->type, NULL, p->withbuf);
init_pes_in(p, p->type, nullptr, p->withbuf);
if (c < count) {
done = 0;
count -= c;
Expand All @@ -391,6 +392,7 @@ void get_pes (pes_in_t *p, uint8_t *buf, int count, void (*func)(pes_in_t *p))
}


#if 0
static uint32_t scr_base_ps(const uint8_t *scr)
{
uint32_t base = 0;
Expand Down Expand Up @@ -423,13 +425,13 @@ static uint16_t scr_ext_ps(const uint8_t *scr)

return ext;
}

#endif


static void init_ps(ps_packet *p)
{
p->stuff_length=0xF8;
p->data = NULL;
p->data = nullptr;
p->sheader_length = 0;
p->audio_bound = 0;
p->video_bound = 0;
Expand All @@ -445,7 +447,7 @@ static void kill_ps(ps_packet *p)

static void setlength_ps(ps_packet *p)
{
short *ll = (short *) p->sheader_llength;
auto *ll = (short *) p->sheader_llength;
p->sheader_length = ntohs(*ll) - 6;
}

Expand Down Expand Up @@ -515,8 +517,8 @@ static int write_ps_header(uint8_t *buf,
init_ps(&p);

uint32_t lscr = htonl((uint32_t) ((SCR/300ULL) & 0x00000000FFFFFFFF));
uint8_t *scr = (uint8_t *) &lscr;
uint16_t scr_ext = (uint16_t) ((SCR%300ULL) & 0x00000000000001FF);
auto *scr = (uint8_t *) &lscr;
auto scr_ext = (uint16_t) ((SCR%300ULL) & 0x00000000000001FF);

// SCR = 0
p.scr[0] = 0x44;
Expand Down Expand Up @@ -605,12 +607,12 @@ int write_pes_header(uint8_t id, int length , uint64_t PTS, uint64_t DTS,
uint8_t headr[3] = {0x00, 0x00, 0x01};

uint32_t lpts = htonl((PTS/300ULL) & 0x00000000FFFFFFFFULL);
uint8_t *pts = (uint8_t *) &lpts;
auto *pts = (uint8_t *) &lpts;
get_pespts(pts,ppts);
if ((PTS/300ULL) & 0x0000000100000000ULL) ppts[0] |= 0x80;

uint32_t ldts = htonl((DTS/300ULL) & 0x00000000FFFFFFFFULL);
uint8_t *dts = (uint8_t *) &ldts;
auto *dts = (uint8_t *) &ldts;
get_pespts(dts,pdts);
if ((DTS/300ULL) & 0x0000000100000000ULL) pdts[0] |= 0x80;

Expand Down Expand Up @@ -715,8 +717,8 @@ int write_video_pes( int pack_size, int extcnt, uint64_t vpts,
pos += write_pes_header( 0xE0, length-pos, vpts, vdts, buf+pos,
stuff, ptsdts);
if (length-pos > *vlength){
LOG(VB_GENERAL, LOG_ERR, "WHAT THE HELL %d > %d", length-pos,
*vlength);
LOG(VB_GENERAL, LOG_ERR,
QString("WHAT THE HELL %1 > %2").arg(length-pos).arg(*vlength));
}

int add = ring_read( vrbuffer, buf+pos, length-pos);
Expand Down Expand Up @@ -770,7 +772,7 @@ int write_audio_pes( int pack_size, int extcnt, int n, uint64_t pts,
pos = pack_size;
}
if (pos != pack_size) {
LOG(VB_GENERAL, LOG_ERR, "apos: %d", pos);
LOG(VB_GENERAL, LOG_ERR, QString("apos: %1").arg(pos));
exit(1);
}

Expand Down Expand Up @@ -823,7 +825,7 @@ int write_ac3_pes( int pack_size, int extcnt, int n,
pos = pack_size;
}
if (pos != pack_size) {
LOG(VB_GENERAL, LOG_ERR, "apos: %d", pos);
LOG(VB_GENERAL, LOG_ERR, QString("apos: %1").arg(pos));
exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythtranscode/external/replex/pes.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef _PES_H_
#define _PES_H_

#include <stdint.h>
#include <cstdint>
#include "ringbuffer.h"

#define TS_HEADER_MIN 4
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mythtv/programs/mythtranscode/external/replex/replex.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#ifndef _REPLEX_H_
#define _REPLEX_H_

#include <stdint.h>
#include <cstdint>
#include "mpg_common.h"
#include "ts.h"
#include "element.h"
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythtranscode/external/replex/replex.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ INSTALLS = target
QMAKE_CLEAN += $(TARGET)

# Input
SOURCES += avi.c element.c mpg_common.c multiplex.c ringbuffer.c
SOURCES += ts.c replex.c pes.c
SOURCES += avi.cpp element.cpp mpg_common.cpp multiplex.cpp ringbuffer.cpp
SOURCES += ts.cpp replex.cpp pes.cpp

HEADERS += avi.h element.h mpg_common.h multiplex.h ringbuffer.h
HEADERS += ts.h replex.h pes.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
*
*/

#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
#include "ringbuffer.h"
#include "pes.h"

Expand Down Expand Up @@ -55,7 +55,7 @@ int ring_init (ringbuffer *rbuf, int size)
int ring_reinit (ringbuffer *rbuf, int size)
{
if (size > (int)(rbuf->size)) {
uint8_t *tmpalloc = (uint8_t *) realloc(rbuf->buffer,
auto *tmpalloc = (uint8_t *) realloc(rbuf->buffer,
sizeof(uint8_t)*size);
if (! tmpalloc)
return -1;
Expand Down Expand Up @@ -96,8 +96,8 @@ int ring_write(ringbuffer *rbuf, uint8_t *data, int count)
if ( free < count ){
if (DEBUG) {
LOG(VB_GENERAL, LOG_ERR,
"ringbuffer overflow %d<%d %d",
free, count, rbuf->size);
QString("ringbuffer overflow %1<%2 %3")
.arg(free).arg(count).arg(rbuf->size));
}
return FULL_BUFFER;
}
Expand All @@ -113,8 +113,8 @@ int ring_write(ringbuffer *rbuf, uint8_t *data, int count)
}

if (DEBUG>1)
LOG(VB_GENERAL, LOG_ERR, "Buffer empty %.2f%%",
ring_free(rbuf)*100.0/rbuf->size);
LOG(VB_GENERAL, LOG_ERR, QString("Buffer empty %1%%")
.arg(ring_free(rbuf)*100.0/rbuf->size, 0,'f',2,QChar('0')));
return count;
}

Expand All @@ -130,8 +130,8 @@ int ring_peek(ringbuffer *rbuf, uint8_t *data, unsigned int count, uint32_t off)
#if 0
if (DEBUG)
LOG(VB_GENERAL, LOG_ERR,
"ringbuffer peek underflow %d<%d %d %d",
avail, count, pos, rbuf->write_pos);
QString("ringbuffer peek underflow %1<%2 %3 %4")
.arg(avail).arg(count).arg(pos).arg(rbuf->write_pos));
#endif
return EMPTY_BUFFER;
}
Expand Down Expand Up @@ -159,8 +159,8 @@ int ring_poke(ringbuffer *rbuf, uint8_t *data, unsigned int count, uint32_t off)
#if 0
if (DEBUG)
LOG(VB_GENERAL, LOG_ERR,
"ringbuffer peek underflow %d<%d %d %d",
avail, count, pos, rbuf->write_pos);
QString("ringbuffer peek underflow %1<%2 %3 %4")
.arg(avail).arg(count).arg(pos).arg(rbuf->write_pos));
#endif
return EMPTY_BUFFER;
}
Expand All @@ -187,8 +187,8 @@ int ring_read(ringbuffer *rbuf, uint8_t *data, int count)
#if 0
if (DEBUG)
LOG(VB_GENERAL, LOG_ERR,
"ringbuffer underflow %d<%d %d \n",
avail, count, rbuf->size);
QString("ringbuffer underflow %1<%2 %3 \n")
.arg(avail).arg(count).arg(rbuf->size));
#endif
return EMPTY_BUFFER;
}
Expand All @@ -204,8 +204,8 @@ int ring_read(ringbuffer *rbuf, uint8_t *data, int count)
}

if (DEBUG>1)
LOG(VB_GENERAL, LOG_ERR, "Buffer empty %.2f%%",
ring_free(rbuf)*100.0/rbuf->size);
LOG(VB_GENERAL, LOG_ERR, QString("Buffer empty %1%%")
.arg(ring_free(rbuf)*100.0/rbuf->size, 0,'f',2,QChar('0')));
return count;
}

Expand All @@ -219,8 +219,8 @@ int ring_skip(ringbuffer *rbuf, int count)
if ( avail < count ){
#if 0
LOG(VB_GENERAL, LOG_ERR,
"ringbuffer skip underflow %d<%d %d %d\n",
avail, count, pos, rbuf->write_pos);
QString("ringbuffer skip underflow %1<%2 %3 %4\n")
.arg(avail).arg(count).arg(pos).arg(rbuf->write_pos));
#endif
return EMPTY_BUFFER;
}
Expand All @@ -231,8 +231,8 @@ int ring_skip(ringbuffer *rbuf, int count)
}

if (DEBUG>1)
LOG(VB_GENERAL, LOG_ERR, "Buffer empty %.2f%%",
ring_free(rbuf)*100.0/rbuf->size);
LOG(VB_GENERAL, LOG_ERR, QString("Buffer empty %1%%")
.arg(ring_free(rbuf)*100.0/rbuf->size, 0,'f',2,QChar('0')));
return count;
}

Expand All @@ -250,8 +250,8 @@ int ring_write_file(ringbuffer *rbuf, int fd, int count)
if ( free < count ){
if (DEBUG) {
LOG(VB_GENERAL, LOG_ERR,
"ringbuffer overflow %d<%d %d %d\n",
free, count, pos, rbuf->read_pos);
QString("ringbuffer overflow %1<%2 %3 %4\n")
.arg(free).arg(count).arg(pos).arg(rbuf->read_pos));
}
return FULL_BUFFER;
}
Expand All @@ -269,8 +269,8 @@ int ring_write_file(ringbuffer *rbuf, int fd, int count)
}

if (DEBUG>1)
LOG(VB_GENERAL, LOG_ERR, "Buffer empty %.2f%%",
ring_free(rbuf)*100.0/rbuf->size);
LOG(VB_GENERAL, LOG_ERR, QString("Buffer empty %.2f%%")
.arg(ring_free(rbuf)*100.0/rbuf->size, 0,'f',2,QChar('0')));
return rr;
}

Expand All @@ -289,8 +289,8 @@ int ring_read_file(ringbuffer *rbuf, int fd, int count)
#if 0
if (DEBUG)
LOG(VB_GENERAL, LOG_ERR,
"ringbuffer underflow %d<%d %d %d",
avail, count, pos, rbuf->write_pos);
QString("ringbuffer underflow %1<%2 %3 %4")
.arg(avail).arg(count).arg(pos).arg(rbuf->write_pos));
#endif
return EMPTY_BUFFER;
}
Expand All @@ -309,48 +309,48 @@ int ring_read_file(ringbuffer *rbuf, int fd, int count)


if (DEBUG>1)
LOG(VB_GENERAL, LOG_ERR, "Buffer empty %.2f%%",
ring_free(rbuf)*100.0/rbuf->size);
LOG(VB_GENERAL, LOG_ERR, QString("Buffer empty %1%%")
.arg(ring_free(rbuf)*100.0/rbuf->size, 0,'f',2,QChar('0')));
return rr;
}


static void show(uint8_t *buf, int length)
{
uint8_t temp[8];
uint8_t buffer[100];
char temp[8];
char buffer[100];
buffer[0] = '\0';

for (int i=0; i<length; i+=16){
int j = 0;
for (j=0; j < 8 && j+i<length; j++)
{
sprintf(temp, "0x%02x ", (int)(buf[i+j]));
strcat(buffer, temp);
std::sprintf(temp, "0x%02x ", (int)(buf[i+j]));
std::strcat(buffer, temp);
}
for (int r=j; r<8; r++)
strcat(buffer, " ");
std::strcat(buffer, " ");

strcat(buffer," ");
std::strcat(buffer," ");

for (j=8; j < 16 && j+i<length; j++)
{
sprintf(temp, "0x%02x ", (int)(buf[i+j]));
strcat(buffer, temp);
std::sprintf(temp, "0x%02x ", (int)(buf[i+j]));
std::strcat(buffer, temp);
}
for (int r=j; r<16; r++)
strcat(buffer, " ");
std::strcat(buffer, " ");

for (j=0; j < 16 && j+i<length; j++){
switch(buf[i+j]){
case '0'...'Z':
case 'a'...'z':
sprintf(temp, "%c", buf[i+j]);
std::sprintf(temp, "%c", buf[i+j]);
break;
default:
sprintf(temp, ".");
std::sprintf(temp, ".");
}
strcat(buffer, temp);
std::strcat(buffer, temp);
}
LOG(VB_GENERAL, LOG_INFO, buffer);
}
Expand All @@ -368,8 +368,8 @@ void ring_show(ringbuffer *rbuf, unsigned int count, uint32_t off)
#if 0
if (DEBUG)
LOG(VB_GENERAL, LOG_ERR,
"ringbuffer peek underflow %d<%d %d %d\n",
avail, count, pos, rbuf->write_pos);
QString("ringbuffer peek underflow %1<%2 %3 %4\n")
.arg(avail).arg(count).arg(pos).arg(rbuf->write_pos));
#endif
return;
}
Expand Down Expand Up @@ -413,15 +413,16 @@ int dummy_add(dummy_buffer *dbuf, uint64_t time, uint32_t size)
{
if (dummy_space(dbuf) < size) return -1;
#if 0
LOG(VB_GENERAL, LOG_INFO, "add %d ", dummy_space(dbuf));
LOG(VB_GENERAL, LOG_INFO, QString("add %1 ").arg(dummy_space(dbuf)));
#endif
dbuf->fill += size;
if (ring_write(&dbuf->time_index, (uint8_t *)&time, sizeof(uint64_t)) < 0)
return -2;
if (ring_write(&dbuf->data_index, (uint8_t *)&size, sizeof(uint32_t)) < 0)
return -3;
#if 0
LOG(VB_GENERAL, LOG_INFO, " - %d = %d", size, dummy_space(dbuf));
LOG(VB_GENERAL, LOG_INFO,
QString(" - %1 = %2").arg(size).arg(dummy_space(dbuf)));
#endif
return size;
}
Expand All @@ -448,16 +449,18 @@ int dummy_delete(dummy_buffer *dbuf, uint64_t time)
} else ex = 1;
} while (!ex);
#if 0
LOG(VB_GENERAL, LOG_INFO, "delete %d ", dummy_space(dbuf));
LOG(VB_GENERAL, LOG_INFO, QString("delete %1 ").arg(dummy_space(dbuf)));
#endif
dbuf->fill -= dsize;
#if 0
LOG(VB_GENERAL, LOG_INFO, " + %d = %d", dsize, dummy_space(dbuf));
LOG(VB_GENERAL, LOG_INFO,
QString(" + %1 = %2").arg(dsize).arg(dummy_space(dbuf)));
#endif

return dsize;
}

#if 0
static void dummy_print(dummy_buffer *dbuf)
{
uint64_t rtime = 0;
Expand All @@ -469,9 +472,10 @@ static void dummy_print(dummy_buffer *dbuf)
ring_peek(&dbuf->data_index,(uint8_t *) &size,
sizeof(uint32_t), i * sizeof(uint32_t));

LOG(VB_GENERAL, LOG_INFO, "%d : %llu %u", i,
(long long unsigned int)rtime, size);
LOG(VB_GENERAL, LOG_INFO, QString("%1 : %2 %3").arg(i)
.arg(rtime).arg(size));
}
LOG(VB_GENERAL, LOG_INFO, "Used: %d Free: %d data-free: %d", avail,
1000-avail, dbuf->size - dbuf->fill);
LOG(VB_GENERAL, LOG_INFO, QString("Used: %d Free: %d data-free: %d")
.arg(avail).arg(1000-avail).arg(dbuf->size - dbuf->fill));
}
#endif
11 changes: 2 additions & 9 deletions mythtv/programs/mythtranscode/external/replex/ringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@
#ifndef _RINGBUFFER_H_
#define _RINGBUFFER_H_

#include <stdio.h>
#include <stdint.h>
#include <cstdio>
#include <cstdint>
#include <unistd.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#define FULL_BUFFER (-1000)
#define EMPTY_BUFFER (-1000)
typedef struct ringbuffer {
Expand Down Expand Up @@ -120,7 +116,4 @@ extern "C" {
void dummy_destroy(dummy_buffer *dbuf);
void ring_show(ringbuffer *rbuf, unsigned int count, uint32_t off);

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _RINGBUFFER_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
*
*/

#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#ifdef _WIN32
#include <winsock2.h>
Expand Down Expand Up @@ -125,7 +125,7 @@ int find_pids_pos(uint16_t *vpid, uint16_t *apid, uint16_t *ac3pid,uint8_t *buf,

int find_pids(uint16_t *vpid, uint16_t *apid, uint16_t *ac3pid,uint8_t *buf, int len)
{
return find_pids_pos(vpid, apid, ac3pid, buf, len, NULL, NULL, NULL);
return find_pids_pos(vpid, apid, ac3pid, buf, len, nullptr, nullptr, nullptr);
}

//taken and adapted from libdtv, (c) Rolf Hakenes
Expand Down Expand Up @@ -210,11 +210,11 @@ static int write_ts_header(int pid, int payload_start, int count,
size--;
}
if(SCR >= 0) {
uint32_t lscr = (uint32_t) ((SCR/300ULL) & 0xFFFFFFFFULL);
auto lscr = (uint32_t) ((SCR/300ULL) & 0xFFFFFFFFULL);
uint8_t bit = (lscr & 0x01) << 7;
lscr = htonl(lscr >> 1);
uint8_t *scr = (uint8_t *) &lscr;
uint16_t scr_ext = (uint16_t) ((SCR%300ULL) & 0x1FFULL);
auto *scr = (uint8_t *) &lscr;
auto scr_ext = (uint16_t) ((SCR%300ULL) & 0x1FFULL);
obuf[c++] = scr[0];
obuf[c++] = scr[1];
obuf[c++] = scr[2];
Expand Down Expand Up @@ -257,8 +257,10 @@ int write_video_ts(uint64_t vpts, uint64_t vdts, uint64_t SCR, uint8_t *buf,
}
if(ptsdts) {
#if 0
LOG(VB_GENERAL, LOG_INFO, "SCR: %f PTS: %f DTS: %f",
SCR/27000000.0, vpts / 27000000.0, vdts / 27000000.0);
LOG(VB_GENERAL, LOG_INFO, QString("SCR: %1 PTS: %2 DTS: %3")
.arg(SCR / 27000000.0, 0,'f')
.arg(vpts / 27000000.0, 0,'f')
.arg(vdts / 27000000.0, 0,'f'));
#endif
pos = write_ts_header(TS_VIDPID, 1, s_count, SCR, buf, stuff);
// always use length == 0 for video streams
Expand All @@ -270,8 +272,8 @@ int write_video_ts(uint64_t vpts, uint64_t vdts, uint64_t SCR, uint8_t *buf,
s_count = (s_count+1) & 0x0f;

if (length-pos > *vlength){
LOG(VB_GENERAL, LOG_ERR, "WHAT THE HELL %d > %d\n", length-pos,
*vlength);
LOG(VB_GENERAL, LOG_ERR, QString("WHAT THE HELL %1 > %2\n")
.arg(length-pos).arg(*vlength));
}

int add = ring_read( vrbuffer, buf+pos, length-pos);
Expand Down Expand Up @@ -318,7 +320,7 @@ int write_audio_ts(int n, uint64_t pts, uint8_t *buf, int *alength,
pos += add;

if (pos != TS_SIZE) {
LOG(VB_GENERAL, LOG_ERR, "apos: %d", pos);
LOG(VB_GENERAL, LOG_ERR, QString("apos: %1").arg(pos));
exit(1);
}

Expand Down Expand Up @@ -368,7 +370,7 @@ int write_ac3_ts(int n, uint64_t pts, uint8_t *buf, int *alength,
pos += add;

if (pos != TS_SIZE) {
LOG(VB_GENERAL, LOG_ERR, "apos: %d", pos);
LOG(VB_GENERAL, LOG_ERR, QString("apos: %1").arg(pos));
exit(1);
}

Expand Down
8 changes: 4 additions & 4 deletions mythtv/programs/mythtranscode/mpeg2fix.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ extern "C"
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"

//replex
#include "external/replex/ringbuffer.h"
#include "external/replex/multiplex.h"

//libmpeg2
#include "config.h"
#if CONFIG_LIBMPEG2EXTERNAL
Expand All @@ -25,6 +21,10 @@ extern "C"
#endif
}

//replex
#include "external/replex/ringbuffer.h"
#include "external/replex/multiplex.h"

//Qt
#include <QMap>
#include <QList>
Expand Down
6 changes: 3 additions & 3 deletions mythtv/programs/mythtranscode/mythtranscode.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ macx: QMAKE_CFLAGS -= -O3 -O2 -O1 -Os
SOURCES += main.cpp transcode.cpp mpeg2fix.cpp
SOURCES += audioreencodebuffer.cpp cutter.cpp videodecodebuffer.cpp
SOURCES += commandlineparser.cpp
SOURCES += external/replex/element.c external/replex/mpg_common.c
SOURCES += external/replex/multiplex.c external/replex/pes.c
SOURCES += external/replex/ringbuffer.c external/replex/ts.c
SOURCES += external/replex/element.cpp external/replex/mpg_common.cpp
SOURCES += external/replex/multiplex.cpp external/replex/pes.cpp
SOURCES += external/replex/ringbuffer.cpp external/replex/ts.cpp

HEADERS += mpeg2fix.h transcodedefs.h commandlineparser.h
HEADERS += audioreencodebuffer.h cutter.h videodecodebuffer.h
Expand Down