mirror of
https://github.com/Motion-Project/motion.git
synced 2026-02-06 21:11:40 -05:00
Merge pull request #383 from iskunk/rtsp-fixes-3
Fix RTSP-related breakage
This commit is contained in:
2
netcam.c
2
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) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user