fixes to compile on old ffmpeg

This commit is contained in:
Isaac Connor 2017-12-01 18:50:28 -05:00
parent 84c901a01b
commit 3ca9b36877
2 changed files with 9 additions and 2 deletions

View File

@ -415,8 +415,7 @@ int zm_receive_frame( AVCodecContext *context, AVFrame *frame, AVPacket &packet
int frameComplete;
while ( !frameComplete ) {
if ( (ret = zm_avcodec_decode_video( context, frame, &frameComplete, &packet )) < 0 ) {
Error( "Unable to decode frame at frame %d: %s, continuing",
streams[packet.stream_index].frame_count,
Error( "Unable to decode frame at frame: %s, continuing",
av_make_error_string(ret).c_str() );
return 0;
}

View File

@ -2811,7 +2811,11 @@ int Monitor::Capture() {
if ( packetqueue.video_packet_count || event ) {
// Need to copy it into another ZMPacket.
ZMPacket *audio_packet = new ZMPacket( *packet );
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
audio_packet->codec_type = camera->get_AudioStream()->codecpar->codec_type;
#else
audio_packet->codec_type = camera->get_AudioStream()->codec->codec_type;
#endif
Debug(2, "Queueing packet");
packetqueue.queuePacket( audio_packet );
}
@ -2822,7 +2826,11 @@ int Monitor::Capture() {
}
Debug(2, "Have video packet");
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
packet->codec_type = camera->get_VideoStream()->codecpar->codec_type;
#else
packet->codec_type = camera->get_VideoStream()->codec->codec_type;
#endif
if ( packet->packet.size && ! packet->in_frame ) {
//Debug(2,"About to decode");