Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

3 views
Skip to first unread message

James Harris

unread,
Mar 7, 2010, 5:11:00 PM3/7/10
to
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

Ian Collins

unread,
Mar 7, 2010, 5:37:13 PM3/7/10
to

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

--
Ian Collins

Robert Fendt

unread,
Mar 7, 2010, 5:40:16 PM3/7/10
to
And thus spake James Harris <james.h...@googlemail.com>
Sun, 7 Mar 2010 14:11:00 -0800 (PST):

> 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

Anthony Delroy

unread,
Mar 7, 2010, 8:06:35 PM3/7/10
to

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

James Harris

unread,
Mar 10, 2010, 6:20:40 PM3/10/10
to
On 7 Mar, 22:40, Robert Fendt <rob...@fendt.net> wrote:
> And thus spake James Harris <james.harri...@googlemail.com>

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

James Harris

unread,
Mar 10, 2010, 6:26:35 PM3/10/10
to

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

0 new messages