From e0f4129b03d084d69e0648a80c1079b0770026df Mon Sep 17 00:00:00 2001 From: Georgi Chorbadzhiyski Date: Mon, 10 Oct 2011 14:57:32 +0300 Subject: [PATCH] dvb/si: Complete support for descriptor 0x48 (Service descriptor). Add desc48_set_length() function. --- dvb/si/desc_48.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dvb/si/desc_48.h b/dvb/si/desc_48.h index 26fdda9..6946601 100644 --- a/dvb/si/desc_48.h +++ b/dvb/si/desc_48.h @@ -4,6 +4,7 @@ * Copyright (C) 2009-2010 VideoLAN * * Authors: Christophe Massiot + * Georgi Chorbadzhiyski * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -96,6 +97,16 @@ static inline uint8_t *desc48_get_service(const uint8_t *p_desc, return p + 1; } +static inline void desc48_set_length(uint8_t *p_desc) +{ + uint8_t i_provider_len, i_service_len; + desc48_get_provider(p_desc, &i_provider_len); + desc48_get_service(p_desc, &i_service_len); + desc_set_length(p_desc, DESC48_HEADER_SIZE - DESC_HEADER_SIZE + + 1 + i_provider_len + + 1 + i_service_len); +} + static inline bool desc48_validate(const uint8_t *p_desc) { uint8_t i_length = desc_get_length(p_desc);