[2/2] rtsp: Request that dynamic rate is disabled

Message ID 1318373243-14306-2-git-send-email-martin@martin.st
State Committed
Commit 76b0d03d827626b9c235812096b0be490a6e4ea0
Headers show

Commit Message

Martin Storsjö Oct. 11, 2011, 10:47 p.m.
DSS enables this automatically if streaming VOD over TCP. If
enabled, the server feeds packets faster than realtime, screwing
up RTCP NTP based timestamps.

Also, DSS doesn't indicate that this was indicated, if it was
enabled automatically (although if it was requested to be enabled,
a header saying that it was enabled is added, but this isn't
added if it is enabled automatically), making it even harder
to detect and work around properly without explicitly asking
for it to be disabled(/enabled, if we were able to support it).
---
AFAIK neither gstreamer nor live555 have any better way of
dealing with this situation either, getting more or less screwed
up timestamps.

This patchset was submitted in January initially, but stalled and
wasn't resubmitted until now.

 libavformat/rtsp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Anton Khirnov Oct. 12, 2011, 8:23 a.m. | #1
On Wed, 12 Oct 2011 01:47:23 +0300, Martin Storsjö <martin@martin.st> wrote:
> DSS enables this automatically if streaming VOD over TCP. If
> enabled, the server feeds packets faster than realtime, screwing
> up RTCP NTP based timestamps.
> 
> Also, DSS doesn't indicate that this was indicated, if it was
> enabled automatically (although if it was requested to be enabled,
> a header saying that it was enabled is added, but this isn't
> added if it is enabled automatically), making it even harder
> to detect and work around properly without explicitly asking
> for it to be disabled(/enabled, if we were able to support it).
> ---
> AFAIK neither gstreamer nor live555 have any better way of
> dealing with this situation either, getting more or less screwed
> up timestamps.
> 
> This patchset was submitted in January initially, but stalled and
> wasn't resubmitted until now.
> 
>  libavformat/rtsp.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 

Both patches look sane enough.
I assume you tested them and they work.
Martin Storsjö Oct. 12, 2011, 11:55 a.m. | #2
On Wed, 12 Oct 2011, Anton Khirnov wrote:

>
> On Wed, 12 Oct 2011 01:47:23 +0300, Martin Storsjö <martin@martin.st> wrote:
>> DSS enables this automatically if streaming VOD over TCP. If
>> enabled, the server feeds packets faster than realtime, screwing
>> up RTCP NTP based timestamps.
>>
>> Also, DSS doesn't indicate that this was indicated, if it was
>> enabled automatically (although if it was requested to be enabled,
>> a header saying that it was enabled is added, but this isn't
>> added if it is enabled automatically), making it even harder
>> to detect and work around properly without explicitly asking
>> for it to be disabled(/enabled, if we were able to support it).
>> ---
>> AFAIK neither gstreamer nor live555 have any better way of
>> dealing with this situation either, getting more or less screwed
>> up timestamps.
>>
>> This patchset was submitted in January initially, but stalled and
>> wasn't resubmitted until now.
>>
>>  libavformat/rtsp.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>
> Both patches look sane enough.
> I assume you tested them and they work.

Applied - yes, they're tested and do what they're supposed to. :-)

// Martin

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2c0b0f7..90f5748 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1168,6 +1168,8 @@  int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
         snprintf(cmd, sizeof(cmd),
                  "Transport: %s\r\n",
                  transport);
+        if (rt->accept_dynamic_rate)
+            av_strlcat(cmd, "x-Dynamic-Rate: 0\r\n", sizeof(cmd));
         if (i == 0 && rt->server_type == RTSP_SERVER_REAL && CONFIG_RTPDEC) {
             char real_res[41], real_csum[9];
             ff_rdt_calc_response_and_checksum(real_res, real_csum,