diff --git a/netcam.c b/netcam.c index 92d0bb41..7d66fde6 100644 --- a/netcam.c +++ b/netcam.c @@ -1875,6 +1875,7 @@ static void *netcam_handler_loop(void *arg) } } +#ifdef HAVE_FFMPEG if (netcam->caps.streaming == NCS_RTSP) { if (!netcam->rtsp->active) { // We must have disconnected. Try to reconnect if ((netcam->rtsp->status == RTSP_CONNECTED) || @@ -1898,6 +1899,7 @@ static void *netcam_handler_loop(void *arg) } } } +#endif /* HAVE_FFMPEG */ if (netcam->caps.streaming != NCS_RTSP) { if (netcam->get_image(netcam) < 0) { diff --git a/netcam_rtsp.c b/netcam_rtsp.c index a4c7db14..29015cc0 100644 --- a/netcam_rtsp.c +++ b/netcam_rtsp.c @@ -105,10 +105,18 @@ static int rtsp_decode_video(AVPacket *packet, AVFrame *frame, AVCodecContext *c #else + AVPacket empty_packet; int retcd; int check = 0; char errstr[128]; + if (!packet) { + av_init_packet(&empty_packet); + empty_packet.data = NULL; + empty_packet.size = 0; + packet = &empty_packet; + } + retcd = avcodec_decode_video2(ctx_codec, frame, &check, packet); if (retcd < 0) { av_strerror(retcd, errstr, sizeof(errstr));