1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-28 23:09:59 +02:00

sout: enforce single frames in pf_send

The stream output API is unclear on chained frame support. Currently,
modules decide if they want to support them or not.
As it seems that the current consensus is to support single frames only,
this assert will help notifying and fixing inconsistents behavior on
that regard.

Note that it could be perfectly valid to pass frames one by one from a
chain without having to NULL every `p_next` entry for each elements so
this assert might be deleted once it is clear that all stream output
modules are fixed to support single frames only.
This commit is contained in:
Alaric Senat 2023-07-05 16:55:15 +02:00 committed by Jean-Baptiste Kempf
parent 7779bf5a36
commit f5872be459
2 changed files with 5 additions and 0 deletions

View File

@ -308,6 +308,9 @@ VLC_API void sout_StreamIdDel(sout_stream_t *, void *id);
* Takes ownership of the frame, it should be considered as invalid
* and released after this call.
*
* \warning Only single frames are expected through this call, for frame chains,
* you'll have to call this for each frames.
*
* \param id The ES identifier that sent the frame.
*
* \retval VLC_SUCCESS on success.

View File

@ -716,6 +716,8 @@ int sout_StreamIdSend(sout_stream_t *s, void *id, vlc_frame_t *f)
{
int val;
assert(f->p_next == NULL);
sout_StreamLock(s);
val = s->ops->send(s, id, f);
sout_StreamUnlock(s);