equal
deleted
inserted
replaced
363 av_init_packet(&Packet); |
363 av_init_packet(&Packet); |
364 Packet.data = NULL; |
364 Packet.data = NULL; |
365 Packet.size = 0; |
365 Packet.size = 0; |
366 |
366 |
367 g_pVFrame->pts++; |
367 g_pVFrame->pts++; |
|
368 #if LIBAVCODEC_VERSION_MAJOR < 58 |
368 if (g_pFormat->flags & AVFMT_RAWPICTURE) |
369 if (g_pFormat->flags & AVFMT_RAWPICTURE) |
369 { |
370 { |
370 /* raw video case. The API will change slightly in the near |
371 /* raw video case. The API will change slightly in the near |
371 future for that. */ |
372 future for that. */ |
372 Packet.flags |= AV_PKT_FLAG_KEY; |
373 Packet.flags |= AV_PKT_FLAG_KEY; |
377 if (av_interleaved_write_frame(g_pContainer, &Packet) != 0) |
378 if (av_interleaved_write_frame(g_pContainer, &Packet) != 0) |
378 return FatalError("Error while writing video frame"); |
379 return FatalError("Error while writing video frame"); |
379 return 0; |
380 return 0; |
380 } |
381 } |
381 else |
382 else |
|
383 #endif |
382 { |
384 { |
383 #if LIBAVCODEC_VERSION_MAJOR >= 54 |
385 #if LIBAVCODEC_VERSION_MAJOR >= 54 |
384 int got_packet; |
386 int got_packet; |
385 if (avcodec_encode_video2(g_pVideo, &Packet, pFrame, &got_packet) < 0) |
387 if (avcodec_encode_video2(g_pVideo, &Packet, pFrame, &got_packet) < 0) |
386 return FatalError("avcodec_encode_video2 failed"); |
388 return FatalError("avcodec_encode_video2 failed"); |