dr_a1: remove dependency on function, dvbpsi_get_bits()

[email protected] (Michael Krufky)
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <[email protected]>
libdvbpsi | branch: master | Michael Krufky <[email protected]> | Sun May 19 16:10:30 2013 -0400| [c09ed74bcd8303a32adb71962fd6a3dc15b9ac7f] | committer: Jean-Paul Saman

dr_a1: remove dependency on function, dvbpsi_get_bits()

Signed-off-by: Michael Krufky <[email protected]>

> http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=c09ed74bcd8303a32adb71962fd6a3dc15b9ac7f
---

 src/descriptors/dr_a1.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/descriptors/dr_a1.c b/src/descriptors/dr_a1.c
index 7cac951..bb0c835 100644
--- a/src/descriptors/dr_a1.c
+++ b/src/descriptors/dr_a1.c
@@ -71,10 +71,10 @@ dvbpsi_service_location_dr_t * dvbpsi_DecodeServiceLocationDr(
 
   p_descriptor->p_decoded = (void*)p_decoded;
 
-  p_decoded->i_pcr_pid = dvbpsi_get_bits(buf, 3, 13);
-  p_decoded->i_number_elements = dvbpsi_get_bits(buf, 16, 8);
+  p_decoded->i_pcr_pid = ((uint16_t)(buf[0] & 0x1f) << 8) | buf[1];
+  p_decoded->i_number_elements = buf[2];
 
-  buf = &p_descriptor->p_data[3];
+  buf += 3;
 
   for (int i = 0; i < p_decoded->i_number_elements; i++)
   {
@@ -85,8 +85,8 @@ dvbpsi_service_location_dr_t * dvbpsi_DecodeServiceLocationDr(
 
     memset(p_element, 0, sizeof(dvbpsi_service_location_element_t));
 
-    p_element->i_stream_type = dvbpsi_get_bits(buf, 0, 8);
-    p_element->i_elementary_pid = dvbpsi_get_bits(buf, 11, 13);
+    p_element->i_stream_type = buf[0];
+    p_element->i_elementary_pid = ((uint16_t)(buf[1] & 0x1f) << 8) | buf[2];
     memcpy(p_element->i_iso_639_code, &buf[3], 3);
 
     if (p_decoded->p_first_element == NULL)

_______________________________________________
libdvbpsi-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvbpsi-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.