Error in dvbcut source - is this valid C++?

J

James Harris

I tried to download the latest dvbcut from

http://dvbcut.sourceforge.net/download.html

and compile it as stated in src/README.ffmpeg. The make resulted in:

src/playaudio.cpp: In function void playaudio(const void*, uint32_t,
AVCodecContext*, AVCodec*):
src/playaudio.cpp:41: error: expected primary-expression before ?
token
and various secondary errors.

Line 41 is the following declaration. I don't recognise the ">?"
construct. Is it valid in C++?

int16_t samples[MIN_BUFFER_SAMPLES >? avcc->frame_size];

James
 
I

Ian Collins

James said:
I tried to download the latest dvbcut from

http://dvbcut.sourceforge.net/download.html

and compile it as stated in src/README.ffmpeg. The make resulted in:

src/playaudio.cpp: In function void playaudio(const void*, uint32_t,
AVCodecContext*, AVCodec*):
src/playaudio.cpp:41: error: expected primary-expression before ?
token
and various secondary errors.

Line 41 is the following declaration. I don't recognise the ">?"
construct. Is it valid in C++?

int16_t samples[MIN_BUFFER_SAMPLES >? avcc->frame_size];

No! Maybe it's some form of gcc extension? C style VLAs support is a
g++ extension.
 
R

Robert Fendt

Line 41 is the following declaration. I don't recognise the ">?"
construct. Is it valid in C++?

int16_t samples[MIN_BUFFER_SAMPLES >? avcc->frame_size];

At least it does not look like any valid C or C++ construct that
I would recognise. MIN_BUFFER_SAMPLES seems to be a simple
#define'd number. Maybe it's remnants of a ?-: operator, but it
will be difficult to 'guess' the original intended meaning.

My guess is that the corresponding code has not been used for
quite some time. The release 0.5.4 also seems to be quite old.
You are probably better off trying a fresh SVN checkout.

Regards,
Robert
 
A

Anthony Delroy

I tried to download the latest dvbcut from

 http://dvbcut.sourceforge.net/download.html

and compile it as stated in src/README.ffmpeg. The make resulted in:

src/playaudio.cpp: In function void playaudio(const void*, uint32_t,
AVCodecContext*, AVCodec*):
src/playaudio.cpp:41: error: expected primary-expression before ?
token
and various secondary errors.

Line 41 is the following declaration. I don't recognise the ">?"
construct. Is it valid in C++?

  int16_t samples[MIN_BUFFER_SAMPLES >? avcc->frame_size];

James

I believe they were removed some time ago, but here's a link showing
this can be replaced with std::max():

http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Min-and-Max.html

Cheers,
Tony
 
J

James Harris

Line 41 is the following declaration. I don't recognise the ">?"
construct. Is it valid in C++?
  int16_t samples[MIN_BUFFER_SAMPLES >? avcc->frame_size];

At least it does not look like any valid C or C++ construct that
I would recognise. MIN_BUFFER_SAMPLES seems to be a simple
#define'd number. Maybe it's remnants of a ?-: operator, but it
will be difficult to 'guess' the original intended meaning.

My guess is that the corresponding code has not been used for
quite some time. The release 0.5.4 also seems to be quite old.
You are probably better off trying a fresh SVN checkout.

Unfortunately that seems to be broken too. Running either make or make
FFMPEG=/usr results in

a@jet1:~/svn/dvbcut$ make
*** Attention, please! ***
The old scons-based build procedure does not work anymore.
Please run "./configure && make && make install" instead.
*** We apologize for any inconvenience. ***
a@jet1:~/svn/dvbcut$

The only configure script is in the ffmpeg.src directory

a@jet1:~/svn/dvbcut$ find . -name configure
../ffmpeg.src/configure
a@jet1:~/svn/dvbcut$

Configure works quickly but the make fails with

make: *** No rule to make target `ffmpeg.o', needed by `ffmpeg_g'.
Stop.

I guess the package is just broken. Thanks for the effort to help,
though.

James
 
J

James Harris

I tried to download the latest dvbcut from

and compile it as stated in src/README.ffmpeg. The make resulted in:
src/playaudio.cpp: In function void playaudio(const void*, uint32_t,
AVCodecContext*, AVCodec*):
src/playaudio.cpp:41: error: expected primary-expression before ?
token
and various secondary errors.
Line 41 is the following declaration. I don't recognise the ">?"
construct. Is it valid in C++?
  int16_t samples[MIN_BUFFER_SAMPLES >? avcc->frame_size];

I believe they were removed some time ago, but here's a link showing
this can be replaced with std::max():

http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Min-and-Max.html

So >? was to yield the max of the two values. Given that this was in a
declaration (and going back to C++ rather than the program written in
it) would it bevalid to write

int16_t samples[MAX > siz ? MAX : siz];

In other words can the ternary operator be used in this way at
declaration time?

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top