This commit is contained in:
Isaac Connor 2021-01-22 19:24:27 -05:00
parent 08165c06df
commit c94e2c0f13
1 changed files with 2 additions and 4 deletions

View File

@ -237,11 +237,9 @@ int FfmpegCamera::Capture(ZMPacket &zm_packet) {
dumpPacket(mFormatContext->streams[packet.stream_index], &packet, "ffmpeg_camera in");
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
//audio_packet->codec_type = camera->get_AudioStream()->codecpar->codec_type;
zm_packet.codec_type = mFormatContext->streams[packet.stream_index]->codecpar->codec_type;
#else
zm_packet.codec_type = mFormatContext->streams[packet.stream_index]->codec->codec_type;
//audio_packet->codec_type = camera->get_AudioStream()->codec->codec_type;
#endif
bytes += packet.size;
zm_packet.set_packet(&packet);
@ -372,10 +370,10 @@ int FfmpegCamera::OpenFfmpeg() {
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
mVideoCodecContext = avcodec_alloc_context3(nullptr);
avcodec_parameters_to_context(mVideoCodecContext,
mFormatContext->streams[mVideoStreamId]->codecpar);
mFormatContext->streams[mVideoStreamId]->codecpar);
// this isn't copied.
mVideoCodecContext->time_base =
mFormatContext->streams[mVideoStreamId]->codec->time_base;
mFormatContext->streams[mVideoStreamId]->codec->time_base;
#else
#endif
//mVideoCodecContext = mFormatContext->streams[mVideoStreamId]->codec;