~ubuntu-branches/ubuntu/precise/gst-plugins-good0.10/precise-proposed

« back to all changes in this revision

Viewing changes to debian/patches/04_rtpgst722pay-compensate-for-clockrate.patch

  • Committer: Steve Langasek
  • Date: 2011-12-13 19:36:21 UTC
  • mfrom: (40.2.36 experimental)
  • Revision ID: vorlon@debian.org-20111213193621-yq2rgkj3x39fhxv0
Merge Debian version 0.10.30.2-2 from experimental

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From bf65acf11fd107376e5591e24f0d93de05057fab Mon Sep 17 00:00:00 2001
2
 
From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
3
 
Date: Mon, 10 Oct 2011 19:01:23 +0100
4
 
Subject: [PATCH] gstrtpg722pay: Compensate for clockrate vs. samplerate
5
 
 difference
6
 
 
7
 
The RTP clock-rate used for G722 is 8000, even though the samplerate is
8
 
16000. Compensate for this by pretending G722 has 8 bits per sample
9
 
instead of the 4 bits as if it were a codec that ran at half the speed,
10
 
but with twice the number of bits. Fixes #661376
11
 
---
12
 
 gst/rtp/gstrtpg722pay.c |    6 ++++--
13
 
 1 files changed, 4 insertions(+), 2 deletions(-)
14
 
 
15
 
diff --git a/gst/rtp/gstrtpg722pay.c b/gst/rtp/gstrtpg722pay.c
16
 
index 29cd22a..45ba4bb 100644
17
 
--- a/gst/rtp/gstrtpg722pay.c
18
 
+++ b/gst/rtp/gstrtpg722pay.c
19
 
@@ -160,9 +160,11 @@ gst_rtp_g722_pay_setcaps (GstBaseRTPPayload * basepayload, GstCaps * caps)
20
 
   rtpg722pay->rate = rate;
21
 
   rtpg722pay->channels = channels;
22
 
 
23
 
-  /* octet-per-sample is 1 * channels for G722 */
24
 
+  /* bits-per-sample is 4 * channels for G722, but as the RTP clock runs at
25
 
+   * half speed (8 instead of 16 khz), pretend it's 8 bits per sample
26
 
+   * channels. */
27
 
   gst_base_rtp_audio_payload_set_samplebits_options (basertpaudiopayload,
28
 
-      4 * rtpg722pay->channels);
29
 
+      8 * rtpg722pay->channels);
30
 
 
31
 
   return res;
32
 
 
33
 
1.7.7.2
34