[Live-devel] hi all, I found a bug in mediaServer source code.
ken chow
kenchow.cn at gmail.com
Mon Dec 8 07:38:17 PST 2014
sorry about that copyright time, we should have updated. but my point is if
utcTimes is "20141208T064100.000Z-\r\nSession: 81A6879B\r\n", then the
sscanf will parse that not we want, please see the sample at the below. if
you're pretty sure that live555-latest.tar.gz is right, then I'm so sorry
for bothering you.
Range: clock=20141208T064100.000Z-
Session: 81A6879B
In this case:
int sscanfResult = sscanf(utcTimes, "%[^-]-%s", as, ae);
when I printf sscanfResult which is actually "2"
when I printf as which is "20141208T064100.000Z"
when I printf ae which is actually "Session:"
<pre>
kenchow at ubuntu:~/Documents$ cat sscanf.c
#include<stdio.h>
#include<string.h>
int main()
{
char *utcTimes = "20141208T064100.000Z-\r\nSession: 81A6879B";
char as[50]={0}, ae[50]={0};
int sscanfResult = sscanf(utcTimes, "%[^-]-%s", as, ae);
printf("%d\n", sscanfResult);
printf("%s\n", as);
printf("%s\n", ae);
return 0;
}
kenchow at ubuntu:~/Documents$ ./sscanf
2
20141208T064100.000Z
Session:
kenchow at ubuntu:~/Documents$
</pre>
<http://about.me/kenchowcn>
Ken Chow
about.me/kenchowcn
[image: Ken Chow on about.me]
<http://about.me/kenchowcn>
On Mon, Dec 8, 2014 at 10:19 PM, Ross Finlayson <finlayson at live555.com>
wrote:
>
> Please see the attachment that I modified two files
>
>
> I’m puzzled that in both of the files that you attached, the copyright
> notice says
> Copyright (c) 1996-2011
> yet support for seeking by absolute time was added in 2012. This suggests
> that you are using modified source files, rather than the unmodified,
> latest source files from http://www.live555.com/liveMedia/public - the
> only version of the code that we support.
>
>
> From my client PLAY request like this:
>
> […]
>
> If the range like the above that I'v offered, the sscanf(utcTimes,
> "%[^-]-%s", as, ae) will have a problem.
>
>
> No it won’t have a problem. In this case, the “sscanf()” call will return
> 1, which means that the code will set the variable “absStartTime”, but not
> the variable “absEndTime”, which means that “absEndTime” will be left at
> its default value of NULL - which means: No end time.
>
> Note that your implementation of the
> seekStreamSource(FramedSource* inputSource, char*& absStart, char*& absEnd)
> virtual function (in your subclass of “OnDemandServerMediaSubsession”)
> needs to allow for the possibility of the “absEnd” parameter being NULL.
>
>
> Another thing:
>
> file: RTSPServer.cpp line: 2002 code:
>
> […]
>
> if (absStart != NULL) { /******************line
> 2002***************************************************/
>
>
> No, that should be line 1951, not line 2002. You are using an old (or
> modified) version of the code. We do not support this!
>
>
> That if condition should have included NULL != absEnd.
>
>
> No, the existing condition is correct. Once again, your implementation of
> the “seekStreamSource()” virtual function needs to allow for the
> possibility of the “absEnd” parameter being NULL.
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141208/a78d2626/attachment-0001.html>
More information about the live-devel
mailing list