Commit af6fb2b9 authored by garciay's avatar garciay
Browse files

Bug fix in regular expression for SDP Times t=<start time>: this valus can be...

Bug fix in regular expression for SDP Times t=<start time>: this valus can be set to 0 (cf. RFC 2327 Page 14)
parent 757c5288
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -42,7 +42,7 @@ namespace t3devlib { namespace gen {
#define SDPREG_DECIMAL_UCHAR "(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(?![0-9])"
#define SDPREG_DECIMAL_UCHAR "(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(?![0-9])"
#define SDPREG_IP4_ADDRESS SDPREG_DECIMAL_UCHAR "(?:[.]" SDPREG_DECIMAL_UCHAR"){3}"
#define SDPREG_IP4_ADDRESS SDPREG_DECIMAL_UCHAR "(?:[.]" SDPREG_DECIMAL_UCHAR"){3}"
#define SDPREG_INTEGER "[1-9][0-9]*"
#define SDPREG_INTEGER "[1-9][0-9]*"
#define SDPREG_TIME_INTEGER "[01-9][0-9]*"
#define SDPREG_TIME_INTEGER "[0-9][0-9]*"
#define SDPREG_BYTE_STRING "["SDPCHARS_BYTE_STRING"]+"
#define SDPREG_BYTE_STRING "["SDPCHARS_BYTE_STRING"]+"


// TODO: support the folding whitespaces/obsolete addresses/... ?
// TODO: support the folding whitespaces/obsolete addresses/... ?
@@ -425,7 +425,7 @@ void SDP_time::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
void SDP_time_field::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
void SDP_time_field::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
{
{
	if (id == id_start_time) {
	if (id == id_start_time) {
		static Regex reg_times ("^(" SDPREG_TIME_INTEGER ")" SDPREG_SP "(" SDPREG_INTEGER ")");
		static Regex reg_times ("^(" SDPREG_TIME_INTEGER ")" SDPREG_SP "(" SDPREG_TIME_INTEGER ")");
		reg_times.AssertMatch (buffer, this);
		reg_times.AssertMatch (buffer, this);
		SetHypFieldLength (id_start_time, reg_times.GetMatchedLength (1));
		SetHypFieldLength (id_start_time, reg_times.GetMatchedLength (1));
		SetHypFieldLength (id_stop_time, reg_times.GetMatchedLength (2));
		SetHypFieldLength (id_stop_time, reg_times.GetMatchedLength (2));