Merge pull request #383 from iskunk/rtsp-fixes-3

Fix RTSP-related breakage
This commit is contained in:
Joseph Heenan
2017-05-12 08:29:41 +01:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -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) {

View File

@@ -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));