R-TS = 0, Tsc = 0 in EXT3 no allowed

Bug #764707 reported by Klaus Warnke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rohc
Status tracked in Rohc-main
1.2.x
Won't Fix
Medium
Didier Barvaux
1.3.x
Won't Fix
Medium
Didier Barvaux
Rohc-main
Fix Released
Medium
Didier Barvaux

Bug Description

test case: ipv4/udp/rtp/mp3 packet 9
[c_generic.c:4094 code_UO2_packet()] code UOR-2-ID packet (CID = 0)
[c_generic.c:5486 code_EXT3_packet()] R-TS = 0, Tsc = 0, rtp = 0

But rfc 4815 4.2:

       If value(Tsc) = 0, the Timestamp value is compressed as-is, and
       default-slope(TS) = value(TS_STRIDE). If a packet with no TS
       bits is received with Tsc = 0, the decompressor MUST discard the
       packet."

Here are Tsc is 0 (TS not scaled, but no TS bits there R-TS=0.
And therefore my decompressor complains:

WARNING: DEC: Tsc=0, but no TS bits received

See code_EXT3_packet();

               /* Tsc bit */
                tsc = rtp_context->ts_sc.state == SEND_SCALED &&
                  !(packet_type == PACKET_UOR_2_ID && is_deductible(rtp_context->ts_sc));

The tsc bit is 0, the second part (after &&, second line) evaluates to !1 -> 0.
But why this additional question in case of UOR_2_ID and is_deductible?
This is wrong from my point of view, because compressor has detected that
RTP TS is scaled (SEND_SCALED), but sets tsc to 0.

regards, Klaus

Revision history for this message
Klaus Warnke (k-warnke) wrote :

Proposal for decompressor fix

d_generic.c:4775 decode_extension3()

                /* decode scaled TS */
                if(tsc)
                {
                        rohc_debugf(3, "TS is scaled\n");

                        if (ts_received_size > 0)
                          ts = d_decode_ts(&rtp_context->ts_sc, ts_received, ts_received_size);
                        else
                          {
                            struct ts_sc_decomp * const ts_sc = &rtp_context->ts_sc;
                            const int sn_diff = *sn - g_context->sn.v_ref_d;
                            ts_sc->ts_scaled += sn_diff;
                            ts = ts_sc->ts_stride * ts_sc->ts_scaled + ts_sc->ts_offset;
                          }
                }

If no ts bits received, the ts jump has to be calculated from sn jump/diff.
In the upper case, the decomp MUST discard packet.

Regards, Klaus

Revision history for this message
Klaus Warnke (k-warnke) wrote :

--- src/comp/c_generic.c 2010-08-22 14:00:49 +0000
+++ src/comp/c_generic.c 2011-05-11 15:43:40 +0000
@@ -5802,9 +5806,7 @@
                f_byte |= (rts & 0x01) << 4;

                /* Tsc bit */
- tsc = (rtp_context->ts_sc.state == SEND_SCALED &&
- !(packet_type == PACKET_UOR_2_ID &&
- is_deductible(rtp_context->ts_sc)));
+ tsc = (rtp_context->ts_sc.state == SEND_SCALED);
                f_byte |= (tsc & 0x01) << 3;

                /* rtp bit: set to 1 if RTP PT changed in this packet or changed

--- src/decomp/d_generic.c 2010-08-22 17:16:24 +0000
+++ src/decomp/d_generic.c 2011-05-11 11:33:21 +0000
@@ -5037,7 +5037,20 @@
                if(tsc)
                {
                        rohc_debugf(3, "TS is scaled\n");
- ts = d_decode_ts(&rtp_context->ts_sc, ts_received, ts_received_size);
+ if (ts_received_size > 0)
+ {
+ ts = d_decode_ts(&rtp_context->ts_sc, ts_received, ts_received_size);
+ }
+ else
+ {
+ struct ts_sc_decomp* ts_sc;
+ int sn_diff;
+
+ ts_sc = &rtp_context->ts_sc;
+ sn_diff = *sn - g_context->sn.v_ref_d;
+ ts_sc->ts_scaled += sn_diff;
+ ts = ts_sc->ts_stride * ts_sc->ts_scaled + ts_sc->ts_offset;
+ }
                }
                else
                {

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

To be confirmed on 1.2.x.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

To be confirmed on 1.3.x.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

To be confirmed on trunk.

tags: added: conformance library rtp
Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Confirmed on branch 1.2.x.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Confirmed on branch 1.3.x.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Confirmed on trunk.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

The bug will not be fixed in the 1.2.x branch. It would break compatibility between 1.2.x releases. The README file was updated to mention the existing bug. See http://bazaar.launchpad.net/~didier-barvaux/rohc/1.2.x/revision/150.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

The bug will not be fixed in the 1.3.x branch. It would break compatibility between 1.3.x releases. The README file was updated to mention the existing bug. See http://bazaar.launchpad.net/~didier-barvaux/rohc/1.3.x/revision/179.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Bug fixed on trunk. See http://bazaar.launchpad.net/~didier-barvaux/rohc/main/revision/305.

Thanks to Klaus Warnke for the bug report and his patch. Thanks to Viveris Technologies for adapting the patch to current source code.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.