Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

changes to build against latest ffmpeg library #143

Merged
merged 2 commits into from
Jun 21, 2011

Conversation

skylex
Copy link

@skylex skylex commented Jun 16, 2011

Changes only related to XBMC-PVR to be able to build with the latests revisions of ffmpeg external library.

@opdenkamp
Copy link
Owner

I don't think those AVMEDIA_ things are defined in older ffmpegs, like the one that is distributed along with xbmc? If that's the case (not sure, haven't looked into the code), this PR will break the standard compilation process (which is using internal-ffmpeg).

@skylex
Copy link
Author

skylex commented Jun 16, 2011

It shouldn't break anything. The AVMEDIA_ things are defined in lib/DllAvCodec.h if ffmpeg's version is too old.

See lib/DllAvCodec.h around line 90.

@skylex
Copy link
Author

skylex commented Jun 16, 2011

Concerning "#define MAX_STREAMS 100", to be perfectly safe, I can make a check like below if you want :

#ifndef MAX_STREAMS
#define MAX_STREAMS 100
#endif

@elupus
Copy link
Collaborator

elupus commented Jun 16, 2011

I'd rather see the need removed than spend more time on it. Just make it a array that get's realloced on each added stream to match ffmpeg number of streams.

@skylex
Copy link
Author

skylex commented Jun 16, 2011

Ok, like this :
CDemuxStream* m_streams[100];

Is that right ?

@elupus
Copy link
Collaborator

elupus commented Jun 17, 2011

nope..

one option could be:

std::vector<CDemuxStream*> m_streams;

then just make sure the array can hold as many as the largest index.

the alternative:

CDemuxStream** m_stream;

then:

m_stream = (CDemuxStream**)realloc(m_stream, new_count * sizeof(CDemuxStream*) );

before you add new streams.

@skylex
Copy link
Author

skylex commented Jun 18, 2011

Ok, well it's beyond my little C++ experience, could you tell me exactly what to change and then I'll commit it ?

would replacing this:

  #define MAX_STREAMS 100
  CDemuxStream* m_streams[MAX_STREAMS]; // maximum number of streams that ffmpeg can handle

by this as you mentionned (I corrected m_stream to m_streams) :

  CDemuxStream** m_streams;
  m_streams = (CDemuxStream**)realloc(m_streams, new_count * sizeof(CDemuxStream*) );

do the trick? is the syntax correct?

@skylex
Copy link
Author

skylex commented Jun 21, 2011

@elepus : perhaps Lars can merge my changes as-is for now, as it works, and we'll think of a better way to declare m_streams later.

Moreover, it would match how it is done right now in DVDDemuxFFmpeg.h from xbmc's mainline :

  #define MAX_STREAMS 100
  CDemuxStream* m_streams[MAX_STREAMS]; // maximum number of streams that ffmpeg can handle

@opdenkamp
Copy link
Owner

I could do that for now, but put the #define MAX_STREAMS between #ifndef first, cause it's already defined here. I can refactor it to get that MAX_STREAMS things out.

@skylex
Copy link
Author

skylex commented Jun 21, 2011

Ok, done ;)

opdenkamp pushed a commit that referenced this pull request Jun 21, 2011
pvr: changes to build against latest ffmpeg library
@opdenkamp opdenkamp merged commit bb01870 into opdenkamp:master Jun 21, 2011
@opdenkamp
Copy link
Owner

I'll factor the MAX_STREAMS out when I got time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants