On Sun, Dec 21, 2008 at 1:13 AM, Michael Tison <[email protected]> wrote: > Hi, > > I'm trying to do something like this: > > ---- > AVCodecContext* c_ctx1 = avcodec_alloc_context(); > AVCodecContext* c_ctx2 = avcodec_alloc_context(); > > AVCodec* codec = avcodec_find_decoder(CODEC_ID_VORBIS); > > int ret1 = avcodec_open(c_ctx1, codec); > int ret2 = avcodec_open(c_ctx2, codec); > ---- > > Then ret2 will be == -1 (ERROR). > > This works with CODEC_ID_MP3 and other video decoders. So I'm not > suppose to open a codec twice or is there an error somewhere else? >
I'd look behind avcodec_open (you should have the source), it either copies the structure from AVCodec or derives upcoming settings from it using the pointers which are available from the AVCodec struct. In case pointers get reused it's of course a nogo to use it with 2 different instances. Markus _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
