This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit cf755be215be278222358204b13d6f38b37bd384 Author: Marvin Scholz <[email protected]> AuthorDate: Wed Dec 3 04:29:53 2025 +0100 Commit: Marvin Scholz <[email protected]> CommitDate: Thu Feb 19 17:18:11 2026 +0100 lavf: replace read_{play,pause} by a single callback --- libavformat/demux.h | 19 ++++++++++++++----- libavformat/demux_utils.c | 8 ++++---- libavformat/rtspdec.c | 16 ++++++++++++++-- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/libavformat/demux.h b/libavformat/demux.h index ab1c001c9f..c0c2164e92 100644 --- a/libavformat/demux.h +++ b/libavformat/demux.h @@ -44,6 +44,15 @@ struct AVDeviceInfoList; */ #define FF_INFMT_FLAG_ID3V2_AUTO (1 << 2) +/** + * Input format stream state + * The stream states to be used for FFInputFormat::read_set_state + */ +enum FFInputFormatStreamState { + FF_INFMT_STATE_PLAY, + FF_INFMT_STATE_PAUSE, + }; + typedef struct FFInputFormat { /** * The public AVInputFormat. See avformat.h for it. @@ -114,16 +123,16 @@ typedef struct FFInputFormat { int64_t *pos, int64_t pos_limit); /** - * Start/resume playing - only meaningful if using a network-based format + * Change the stream state - only meaningful if using a network-based format * (RTSP). */ - int (*read_play)(struct AVFormatContext *); + int (*read_set_state)(struct AVFormatContext *, + enum FFInputFormatStreamState state); /** - * Pause playing - only meaningful if using a network-based format - * (RTSP). + * Currently unused. */ - int (*read_pause)(struct AVFormatContext *); + int (*unused)(void); /** * Seek to timestamp ts. diff --git a/libavformat/demux_utils.c b/libavformat/demux_utils.c index b632277460..34b6ba4ac7 100644 --- a/libavformat/demux_utils.c +++ b/libavformat/demux_utils.c @@ -172,8 +172,8 @@ int ff_add_param_change(AVPacket *pkt, int32_t channels, int av_read_play(AVFormatContext *s) { - if (ffifmt(s->iformat)->read_play) - return ffifmt(s->iformat)->read_play(s); + if (ffifmt(s->iformat)->read_set_state) + return ffifmt(s->iformat)->read_set_state(s, FF_INFMT_STATE_PLAY); if (s->pb) return avio_pause(s->pb, 0); return AVERROR(ENOSYS); @@ -181,8 +181,8 @@ int av_read_play(AVFormatContext *s) int av_read_pause(AVFormatContext *s) { - if (ffifmt(s->iformat)->read_pause) - return ffifmt(s->iformat)->read_pause(s); + if (ffifmt(s->iformat)->read_set_state) + return ffifmt(s->iformat)->read_set_state(s, FF_INFMT_STATE_PAUSE); if (s->pb) return avio_pause(s->pb, 1); return AVERROR(ENOSYS); diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 88a57b01ef..3681b57ee7 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -611,6 +611,19 @@ static int rtsp_read_pause(AVFormatContext *s) return 0; } +static int rtsp_read_set_state(AVFormatContext *s, + enum FFInputFormatStreamState state) +{ + switch (state) { + case FF_INFMT_STATE_PLAY: + return rtsp_read_play(s); + case FF_INFMT_STATE_PAUSE: + return rtsp_read_pause(s); + default: + return AVERROR(ENOTSUP); + } +} + int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply) { RTSPState *rt = s->priv_data; @@ -1005,6 +1018,5 @@ const FFInputFormat ff_rtsp_demuxer = { .read_packet = rtsp_read_packet, .read_close = rtsp_read_close, .read_seek = rtsp_read_seek, - .read_play = rtsp_read_play, - .read_pause = rtsp_read_pause, + .read_set_state = rtsp_read_set_state, }; _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
