mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-31 15:49:57 +00:00
rtspdec: Move rtsp_read_pause up, next to rtsp_read_play
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
(cherry picked from commit e836b1b085
)
This commit is contained in:
parent
3f44e3c91a
commit
2afd30bf7a
@ -86,6 +86,24 @@ static int rtsp_read_play(AVFormatContext *s)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* pause the stream */
|
||||||
|
static int rtsp_read_pause(AVFormatContext *s)
|
||||||
|
{
|
||||||
|
RTSPState *rt = s->priv_data;
|
||||||
|
RTSPMessageHeader reply1, *reply = &reply1;
|
||||||
|
|
||||||
|
if (rt->state != RTSP_STATE_STREAMING)
|
||||||
|
return 0;
|
||||||
|
else if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) {
|
||||||
|
ff_rtsp_send_cmd(s, "PAUSE", rt->control_uri, NULL, reply, NULL);
|
||||||
|
if (reply->status_code != RTSP_STATUS_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rt->state = RTSP_STATE_PAUSED;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
|
int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
|
||||||
{
|
{
|
||||||
RTSPState *rt = s->priv_data;
|
RTSPState *rt = s->priv_data;
|
||||||
@ -292,24 +310,6 @@ static int rtsp_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pause the stream */
|
|
||||||
static int rtsp_read_pause(AVFormatContext *s)
|
|
||||||
{
|
|
||||||
RTSPState *rt = s->priv_data;
|
|
||||||
RTSPMessageHeader reply1, *reply = &reply1;
|
|
||||||
|
|
||||||
if (rt->state != RTSP_STATE_STREAMING)
|
|
||||||
return 0;
|
|
||||||
else if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) {
|
|
||||||
ff_rtsp_send_cmd(s, "PAUSE", rt->control_uri, NULL, reply, NULL);
|
|
||||||
if (reply->status_code != RTSP_STATUS_OK) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rt->state = RTSP_STATE_PAUSED;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int rtsp_read_seek(AVFormatContext *s, int stream_index,
|
static int rtsp_read_seek(AVFormatContext *s, int stream_index,
|
||||||
int64_t timestamp, int flags)
|
int64_t timestamp, int flags)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user