[libav-bugs] [Bug 75] av_opt_find2() segfaults

bugzilla-daemon at aruru.libav.org bugzilla-daemon at aruru.libav.org
Fri Nov 18 18:21:12 CET 2011


http://bugzilla.libav.org/show_bug.cgi?id=75

--- Comment #2 from Ondrej Perutka <perutka.ondrej at gmail.com> 2011-11-18 18:21:12 CET ---
(In reply to comment #1)
> Which is the fmt passed to the function?

fmt is created using avformat_alloc_context(), I use following sequence of
commands (it's a bit simplified):

const char *name = "rtp://localhost:12345";

AVFormatContext *fmt = avformat_alloc_context();
strcpy(fmt->filename, name);

fmt->oformat = av_guess_format("rtp", name, NULL);

if (!(fmt->oformat->flags & AVFMT_NOFILE))
    avio_open(&fmt->pb, name, AVIO_FLAG_WRITE);

AVStream *stream = avformat_new_stream(fmt, null);
stream->codec->codec_id = CODEC_ID_MPEG4;
stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
stream->codec->bit_rate = 800000;
stream->codec->width = 320;
stream->codec->height = 240;
stream->codec->time_base.num = 1;
stream->codec->time_base.den = 25;
stream->codec->gop_size = 12;
stream->codec->pix_fmt = PIX_FMT_YUV420P;

if (fmt->oformat->flags & AVFMT_GLOBALHEADER)
    stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;

const char *data = malloc(4096);
av_sdp_create(&fmt, 1, data, 4096); // on this line I get segfault
// ...

-- 
Configure bugmail: http://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list