Teletext subtitles not parsed correctly. (1 Viewer)

te3hpurp

Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    Hi all.

    I came a cross a situation by accident. I have thought that one of my channels have no subtitles. Dvb or Teletext.
    On one day I started tvSetup and runned that channel with manual control and viewed it with vlc player, I was suprices that
    there was teletext subtitles. Mediaportal has never showed them, so I started to do some digging and came to see in mediaportal.log
    these lines:
    [2017-09-22 13:52:59,155] [Log ] [MPMain ] [INFO ] - Prefered language 1 is fin
    [2017-09-22 13:52:59,160] [Log ] [MPMain ] [INFO ] - Prefered language 2 is swe
    [2017-09-22 13:52:59,165] [Log ] [MPMain ] [INFO ] - Prefered language 3 is eng
    [2017-09-22 13:52:59,190] [Log ] [MPMain ] [INFO ] - TSReaderPlayer:GetVideoSize() failed
    [2017-09-22 13:52:59,195] [Log ] [MPMain ] [INFO ] - TSReaderPlayer:VideoSize:100x100
    [2017-09-22 13:52:59,267] [Error ] [9 ] [ERROR] - Assertion failed in PESDecoder: PESDECODER: pos 186 would cause an IndexOutOfBounds exception!
    [2017-09-22 13:52:59,277] [Log ] [9 ] [WARN ] - PESDECODER: Buffer is not empty, but new packet is being received!
    [2017-09-22 13:52:59,282] [Error ] [9 ] [ERROR] - Assertion failed in PESDecoder: PESDECODER: pos 186 would cause an IndexOutOfBounds exception!
    [2017-09-22 13:52:59,292] [Log ] [9 ] [WARN ] - PESDECODER: Buffer is not empty, but new packet is being received!

    Vlc player plays them fine. screen Capture is from same dump that i have made for this report.

    Br,
     

    Attachments

    • vlc_vorking.JPG
      vlc_vorking.JPG
      95.1 KB
    • finland_viasat_iptv_viasat_ACTION.zip
      38.2 MB

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hello

    I can see the problem in the code. Unfortunately I can no longer build a patch for you to try. :(

    MediaPortal-1/PESDecoder.cs at master · MediaPortal/MediaPortal-1 · GitHub

    Current code:
    Code:
            assert(pos >= 0 && pos <= tsPacket.Length - 8, "PESDECODER: pos " + pos + " would cause an IndexOutOfBounds exception!");
    
            if (header.PayloadUnitStart) // if this header starts a new PES packet
            {
              //Log.Debug("PESDECODER: PayLoadUnitStart");
              hasPayloadStart = true;
              if (tsPacket[pos + 0] == 0 && tsPacket[pos + 1] == 0 && tsPacket[pos + 2] == 1)
              {
                int streamId = tsPacket[pos + 3];

    Better code:
    Code:
            if (header.PayloadUnitStart) // if this header starts a new PES packet
            {
              assert(pos >= 0 && pos <= tsPacket.Length - 3, "PESDECODER: pos " + pos + " would cause an IndexOutOfBounds exception!");
              //Log.Debug("PESDECODER: PayLoadUnitStart");
              hasPayloadStart = true;
              if (tsPacket[pos + 0] == 0 && tsPacket[pos + 1] == 0 && tsPacket[pos + 2] == 1)
              {
                assert(pos >= 0 && pos <= tsPacket.Length - 9, "PESDECODER: pos " + pos + " would cause an IndexOutOfBounds exception!");
                int streamId = tsPacket[pos + 3];
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    I just built and tested.

    The changes work out of the box.

    This should go into Jira & git as a Fix

    thank you very very much !!!!

    Br,
     

    Users who are viewing this thread

    Top Bottom