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

Discussion in 'C++' started by James Harris, Mar 7, 2010.

  1. James Harris

    James Harris Guest

    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
    James Harris, Mar 7, 2010
    #1
    1. Advertising

  2. James Harris

    Ian Collins Guest

    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
    Ian Collins, Mar 7, 2010
    #2
    1. Advertising

  3. James Harris

    Robert Fendt Guest

    And thus spake James Harris <>
    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
    Robert Fendt, Mar 7, 2010
    #3
  4. On Mar 8, 7:11 am, 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];
    >
    > 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
    Anthony Delroy, Mar 8, 2010
    #4
  5. James Harris

    James Harris Guest

    On 7 Mar, 22:40, Robert Fendt <> wrote:
    > And thus spake James Harris <>
    > 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
    James Harris, Mar 10, 2010
    #5
  6. James Harris

    James Harris Guest

    On 8 Mar, 01:06, Anthony Delroy <> wrote:
    > On Mar 8, 7:11 am, 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];

    >
    > > 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


    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
    James Harris, Mar 10, 2010
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew
    Replies:
    0
    Views:
    665
    Andrew
    Aug 12, 2003
  2. Stefan Landgraf

    Re: 'Specified Cast Is Not Valid' Error!

    Stefan Landgraf, Aug 19, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    406
    Stefan Landgraf
    Aug 19, 2003
  3. Miguel Angel Dinelli
    Replies:
    1
    Views:
    444
    Chris Jackson
    Nov 13, 2003
  4. Justin

    Error-- Specified cast is not valid

    Justin, Dec 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    428
    Kevin Spencer
    Dec 3, 2003
  5. sviau
    Replies:
    3
    Views:
    4,755
    Steven Cheng[MSFT]
    Feb 17, 2004
Loading...

Share This Page