From 16902de6f4215ccd425622b92e8ae6be1ae4a97f Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 27 Aug 2010 10:42:16 +0200 Subject: Another seek fix by Aholst from the enigma2-devel ml ------------------------------------------------------------------ And one more fix on this theme: rewind and higher than 8 times forward doesn't work for some movies. It turns out that when I and Felix communicated about the "accurate speed winding" that he eventually implemented, introducing the .sc files, we both made a false assumption (sorry if I lead you into it), that it was enough to jump to an I-frame picture start. However, it appears that (for an SD-movie that is) one should jump to the sequence start instead. (This is actually what the c++-code already does when dealing with the .ap-file, but not for the .sc) Since most movies have the sequence and picture start in the same ts-frame it usually doesn't matter. But there are movies out there with the sequence start in a ts-frame before the picture start, and for them rewind and very fast forward currently just freezes playback instead. The below patch fixes that. It just backs up through .sc to the previous sequence start once the picture start is found. Also, alignment has to be done here again and not in dvb.cpp, to get the right winding speed. Please ask me for the full technical details if something is unclear. ------------------------------------------------------------------ refs bug #570 --- lib/dvb/tstools.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'lib/dvb/tstools.cpp') diff --git a/lib/dvb/tstools.cpp b/lib/dvb/tstools.cpp index d5ad2494..a0e4eb15 100644 --- a/lib/dvb/tstools.cpp +++ b/lib/dvb/tstools.cpp @@ -698,9 +698,23 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram else if (direction == +1) direction = 0; } - /* let's find the next frame after the given offset */ off_t start = offset; + /* backtrack to find the previous sequence start, in case of MPEG2 */ + if ((data & 0xFF) == 0x00) { + do { + --start; + if (m_streaminfo.getStructureEntry(start, data, 0)) + { + eDebug("get previous failed"); + return -1; + } + } while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00) && ((data & 0xFF) != 0xB3)); /* sequence start or previous frame */ + if ((data & 0xFF) != 0xB3) + start = offset; /* Failed to find corresponding sequence start, so never mind */ + } + + /* let's find the next frame after the given offset */ do { if (m_streaminfo.getStructureEntry(offset, data, 1)) { @@ -716,8 +730,8 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram } while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00)); /* next frame */ /* align to TS pkt start */ -// start = start - (start % 188); -// offset = offset - (offset % 188); + start = start - (start % 188); + offset = offset - (offset % 188); len = offset - start; _offset = start; -- cgit v1.2.3 From 266943db269293b00a9f2b59338b81cca5a928be Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 24 Nov 2010 23:09:52 +0100 Subject: add DTS-HD as known audio format, add detection to pmt parser (no hardware support for DTS-HD yet) --- lib/dvb/decoder.cpp | 3 +++ lib/dvb/decoder.h | 2 +- lib/dvb/idvb.h | 2 +- lib/dvb/pmt.cpp | 7 +++++++ lib/dvb/pmt.h | 2 +- lib/dvb/tstools.cpp | 2 ++ lib/service/servicedvb.cpp | 2 ++ 7 files changed, 17 insertions(+), 3 deletions(-) (limited to 'lib/dvb/tstools.cpp') diff --git a/lib/dvb/decoder.cpp b/lib/dvb/decoder.cpp index 88cd3ee1..8ed9f43f 100644 --- a/lib/dvb/decoder.cpp +++ b/lib/dvb/decoder.cpp @@ -203,6 +203,9 @@ int eDVBAudio::startPid(int pid, int type) case aLPCM: bypass = 6; break; + case aDTSHD: + bypass = 0x10; + break; } eDebugNoNewLine("AUDIO_SET_BYPASS(%d) - ", bypass); diff --git a/lib/dvb/decoder.h b/lib/dvb/decoder.h index 3a0fbac1..7610b654 100644 --- a/lib/dvb/decoder.h +++ b/lib/dvb/decoder.h @@ -13,7 +13,7 @@ private: ePtr m_demux; int m_fd, m_fd_demux, m_dev, m_is_freezed; public: - enum { aMPEG, aAC3, aDTS, aAAC, aAACHE, aLPCM }; + enum { aMPEG, aAC3, aDTS, aAAC, aAACHE, aLPCM, aDTSHD }; eDVBAudio(eDVBDemux *demux, int dev); enum { aMonoLeft, aStereo, aMonoRight }; void setChannel(int channel); diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index f15cd04e..e56a2c7b 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -650,7 +650,7 @@ public: /** Set Displayed Video PID and type */ virtual RESULT setVideoPID(int vpid, int type)=0; - enum { af_MPEG, af_AC3, af_DTS, af_AAC }; + enum { af_MPEG, af_AC3, af_DTS, af_AAC, af_DTSHD }; /** Set Displayed Audio PID and type */ virtual RESULT setAudioPID(int apid, int type)=0; diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp index e54601cf..0b3e34a3 100644 --- a/lib/dvb/pmt.cpp +++ b/lib/dvb/pmt.cpp @@ -305,6 +305,13 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program) isaudio = 1; audio.type = audioStream::atDTS; } + case 0x86: // Blueray DTS-HD (dvb user private...) + case 0xA6: // Blueray secondary DTS-HD + if (!isvideo && !isaudio) + { + isaudio = 1; + audio.type = audioStream::atDTSHD; + } case 0x06: // PES Private case 0xEA: // TS_PSI_ST_SMPTE_VC1 { diff --git a/lib/dvb/pmt.h b/lib/dvb/pmt.h index de0de052..e61f8713 100644 --- a/lib/dvb/pmt.h +++ b/lib/dvb/pmt.h @@ -144,7 +144,7 @@ public: { int pid, rdsPid; // hack for some radio services which transmit radiotext on different pid (i.e. harmony fm, HIT RADIO FFH, ...) - enum { atMPEG, atAC3, atDTS, atAAC, atAACHE, atLPCM }; + enum { atMPEG, atAC3, atDTS, atAAC, atAACHE, atLPCM, atDTSHD }; int type; // mpeg2, ac3, dts, ... int component_tag; diff --git a/lib/dvb/tstools.cpp b/lib/dvb/tstools.cpp index cfea3fdd..e93cfc0a 100644 --- a/lib/dvb/tstools.cpp +++ b/lib/dvb/tstools.cpp @@ -212,6 +212,8 @@ int eDVBTSTools::getPTS(off_t &offset, pts_t &pts, int fixed) break; case 0x71: // AC3 / DTS break; + case 0x72: // DTS - HD + break; default: eDebug("skip unknwn stream_id_extension %02x\n", payload[9+offs]); continue; diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 0d617c30..0a2146db 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -1797,6 +1797,8 @@ RESULT eDVBServicePlay::getTrackInfo(struct iAudioTrackInfo &info, unsigned int info.m_description = "AAC-HE"; else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atDTS) info.m_description = "DTS"; + else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atDTSHD) + info.m_description = "DTS-HD"; else info.m_description = "???"; -- cgit v1.2.3 From 0c264458b72ac77a0129c8a702d3e8dad70f0e49 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 30 Nov 2010 01:51:02 +0100 Subject: disable backtrack to prev sequence start code this code have to be reviewed.. it breaks fast forward winding with speed > 32x refs #570 --- lib/dvb/tstools.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/dvb/tstools.cpp') diff --git a/lib/dvb/tstools.cpp b/lib/dvb/tstools.cpp index a0e4eb15..438f6d60 100644 --- a/lib/dvb/tstools.cpp +++ b/lib/dvb/tstools.cpp @@ -700,6 +700,7 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram } off_t start = offset; +#if 0 /* backtrack to find the previous sequence start, in case of MPEG2 */ if ((data & 0xFF) == 0x00) { do { @@ -714,6 +715,8 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram start = offset; /* Failed to find corresponding sequence start, so never mind */ } +#endif + /* let's find the next frame after the given offset */ do { if (m_streaminfo.getStructureEntry(offset, data, 1)) @@ -729,9 +732,11 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram // eDebug("%08llx@%llx (next)", data, offset); } while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00)); /* next frame */ +#if 0 /* align to TS pkt start */ start = start - (start % 188); offset = offset - (offset % 188); +#endif len = offset - start; _offset = start; -- cgit v1.2.3