}
}
- return -1;
+ return 0;
}
static int msnwc_tcp_read_header(AVFormatContext *ctx)
{
AVIOContext *pb = ctx->pb;
- AVCodecContext *codec;
+ AVCodecParameters *par;
AVStream *st;
st = avformat_new_stream(ctx, NULL);
if (!st)
return AVERROR(ENOMEM);
- codec = st->codec;
- codec->codec_type = AVMEDIA_TYPE_VIDEO;
- codec->codec_id = AV_CODEC_ID_MIMIC;
- codec->codec_tag = MKTAG('M', 'L', '2', '0');
+ par = st->codecpar;
+ par->codec_type = AVMEDIA_TYPE_VIDEO;
+ par->codec_id = AV_CODEC_ID_MIMIC;
+ par->codec_tag = MKTAG('M', 'L', '2', '0');
avpriv_set_pts_info(st, 32, 1, 1000);
if (pb->eof_reached) {
av_log(ctx, AV_LOG_ERROR, "Could not find valid start.");
- return -1;
+ return AVERROR_INVALIDDATA;
}
return 0;