[vlc-commits] demux: ts: add dvbpsi atsc decoders fixes
Francois Cartegnie
git at videolan.org
Wed Feb 10 10:38:56 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 8 12:12:53 2016 +0100| [ab7c36a7b8f69b4af63b50d2144f73e49243da7a] | committer: Francois Cartegnie
demux: ts: add dvbpsi atsc decoders fixes
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ab7c36a7b8f69b4af63b50d2144f73e49243da7a
---
modules/demux/mpeg/ts_psip_dvbpsi_fixes.c | 55 +++++++++++++++++++++++++++++
modules/demux/mpeg/ts_psip_dvbpsi_fixes.h | 24 +++++++++++++
2 files changed, 79 insertions(+)
diff --git a/modules/demux/mpeg/ts_psip_dvbpsi_fixes.c b/modules/demux/mpeg/ts_psip_dvbpsi_fixes.c
new file mode 100644
index 0000000..d939962
--- /dev/null
+++ b/modules/demux/mpeg/ts_psip_dvbpsi_fixes.c
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * ts_psip_dvbpsi_fixes.c : TS demux Broken/missing dvbpsi PSIP handling
+ *****************************************************************************
+ * Copyright (C) 2016 - VideoLAN Authors
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+
+#ifndef _DVBPSI_DVBPSI_H_
+ #include <dvbpsi/dvbpsi.h>
+#endif
+#include <dvbpsi/psi.h>
+#include <dvbpsi/descriptor.h>
+#include <dvbpsi/atsc_stt.h>
+
+#include "ts_psip_dvbpsi_fixes.h"
+
+#include "ts_psip.h"
+#include "ts_decoders.h"
+
+/* Our own STT Decoder since DVBPlague deduplicates tables for this fixed version table */
+dvbpsi_atsc_stt_t * DVBPlague_STT_Decode( const dvbpsi_psi_section_t* p_section )
+{
+ size_t i_payload = p_section->p_payload_end - p_section->p_payload_start;
+ if( i_payload >= 8 )
+ {
+ dvbpsi_atsc_stt_t *p_stt = dvbpsi_atsc_NewSTT( ATSC_STT_TABLE_ID, 0x00, 0x00, true );
+ if(unlikely(!p_stt))
+ return NULL;
+
+ p_stt->i_system_time = GetDWBE( &p_section->p_payload_start[1] );
+ p_stt->i_gps_utc_offset = p_section->p_payload_start[5];
+ p_stt->i_daylight_savings = GetWBE( &p_section->p_payload_start[6] );
+
+ return p_stt;
+ }
+
+ return NULL;
+}
diff --git a/modules/demux/mpeg/ts_psip_dvbpsi_fixes.h b/modules/demux/mpeg/ts_psip_dvbpsi_fixes.h
new file mode 100644
index 0000000..6d26bee
--- /dev/null
+++ b/modules/demux/mpeg/ts_psip_dvbpsi_fixes.h
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * ts_psip_dvbpsi_fixes.h : TS demux Broken/missing dvbpsi PSIP handling
+ *****************************************************************************
+ * Copyright (C) 2016 - VideoLAN Authors
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *****************************************************************************/
+#ifndef VLC_TS_PSIP_DVBPSI_FIXES_H
+#define VLC_TS_PSIP_DVBPSI_FIXES_H
+
+dvbpsi_atsc_stt_t * DVBPlague_STT_Decode( const dvbpsi_psi_section_t* p_section );
+
+#endif
More information about the vlc-commits
mailing list