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