Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Error in dvbcut source - is this valid C++?

Reply
Thread Tools

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

 
 
James Harris
Guest
Posts: n/a
 
      03-07-2010
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
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      03-07-2010
James Harris wrote:
> 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.

--
Ian Collins
 
Reply With Quote
 
 
 
 
Robert Fendt
Guest
Posts: n/a
 
      03-07-2010
And thus spake James Harris <(E-Mail Removed)>
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

 
Reply With Quote
 
Anthony Delroy
Guest
Posts: n/a
 
      03-08-2010
On Mar 8, 7:11*am, James Harris <(E-Mail Removed)> wrote:
> 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....n-and-Max.html

Cheers,
Tony
 
Reply With Quote
 
James Harris
Guest
Posts: n/a
 
      03-10-2010
On 7 Mar, 22:40, Robert Fendt <(E-Mail Removed)> wrote:
> And thus spake James Harris <(E-Mail Removed)>
> 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.


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
 
Reply With Quote
 
James Harris
Guest
Posts: n/a
 
      03-10-2010
On 8 Mar, 01:06, Anthony Delroy <(E-Mail Removed)> wrote:
> On Mar 8, 7:11*am, James Harris <(E-Mail Removed)> wrote:
>
>
>
> > 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....n-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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get error 1766 no valid source for photogallery? Jimmy Computer Support 1 08-13-2005 11:06 PM
Help w/Tracking Source of bogus error message: "Bad Image": SensAPI.DLL not a valid Windows Image mutu Computer Support 1 05-01-2005 11:00 AM
PRB: Error Message: System.InvalidCastException: Specified Cast Is Not Valid Miguel Angel Dinelli ASP .Net 1 11-13-2003 07:56 PM
Re: 'Specified Cast Is Not Valid' Error! Stefan Landgraf ASP .Net 0 08-19-2003 02:04 PM
I get the following error ( Specified cast is not valid ) with Server.Transfer Andrew ASP .Net 0 08-12-2003 08:26 PM



Advertisments