avprotocol: Return EOF when stream is out of data

According to the ffmpeg documentation[1] the read_packet function should never
return 0. ffmpegdata_peek returns 0 when the stream is EOF causing us to fail
detecting EOF and never close the pipeline, continually spinning on more data.
ffmpeg instead wants an AVERROR_EOF code for to signal EOF.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4999>
This commit is contained in:
Jesper Jensen 2023-07-09 23:21:16 +02:00 committed by GStreamer Marge Bot
parent efa0a3ec6a
commit 825f52d38b

View file

@ -98,7 +98,7 @@ gst_ffmpegdata_read (void *priv_data, unsigned char *buf, int size)
GST_DEBUG ("Returning %d bytes", res);
return res;
return res == 0 ? AVERROR_EOF : res;
}
static int