- vst = avformat_new_stream(s, NULL);
- if (!vst)
- return AVERROR(ENOMEM);
- vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
- vst->codecpar->codec_tag = read_line_and_int(pb, &error); // video format
- vst->codecpar->width = read_line_and_int(pb, &error); // video width
- vst->codecpar->height = read_line_and_int(pb, &error); // video height
- vst->codecpar->bits_per_coded_sample = read_line_and_int(pb, &error); // video bits per sample
- error |= read_line(pb, line, sizeof(line)); // video frames per second
- fps = read_fps(line, &error);
- avpriv_set_pts_info(vst, 32, fps.den, fps.num);
-
- // Figure out the video codec
- switch (vst->codecpar->codec_tag) {
+ video_format = read_line_and_int(pb, &error);
+ if (video_format) {
+ vst = avformat_new_stream(s, NULL);
+ if (!vst)
+ return AVERROR(ENOMEM);
+ vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+ vst->codecpar->codec_tag = video_format;
+ vst->codecpar->width = read_line_and_int(pb, &error); // video width
+ vst->codecpar->height = read_line_and_int(pb, &error); // video height
+ vst->codecpar->bits_per_coded_sample = read_line_and_int(pb, &error); // video bits per sample
+
+ // Figure out the video codec
+ switch (vst->codecpar->codec_tag) {