Teletext subtitles not parsed correctly.

Discussion in 'Watch / Listen Media' started by te3hpurp, September 22, 2017.

  1. te3hpurp
    • Premium Supporter

    te3hpurp Retired Team Member

    Joined:
    September 23, 2008
    Messages:
    904
    Likes Received:
    182
    Gender:
    Male
    Occupation:
    Senior Software Architect
    Location:
    Rovaniemi
    Ratings:
    +229 / 0
    Home Country:
    Finland Finland
    Show System Specs
    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,
     

    Attached Files:

  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    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 (Text):
    1.         assert(pos >= 0 && pos <= tsPacket.Length - 8, "PESDECODER: pos " + pos + " would cause an IndexOutOfBounds exception!");
    2.  
    3.         if (header.PayloadUnitStart) // if this header starts a new PES packet
    4.         {
    5.           //Log.Debug("PESDECODER: PayLoadUnitStart");
    6.           hasPayloadStart = true;
    7.           if (tsPacket[pos + 0] == 0 && tsPacket[pos + 1] == 0 && tsPacket[pos + 2] == 1)
    8.           {
    9.             int streamId = tsPacket[pos + 3];
    10.  
    Better code:
    Code (Text):
    1.         if (header.PayloadUnitStart) // if this header starts a new PES packet
    2.         {
    3.           assert(pos >= 0 && pos <= tsPacket.Length - 3, "PESDECODER: pos " + pos + " would cause an IndexOutOfBounds exception!");
    4.           //Log.Debug("PESDECODER: PayLoadUnitStart");
    5.           hasPayloadStart = true;
    6.           if (tsPacket[pos + 0] == 0 && tsPacket[pos + 1] == 0 && tsPacket[pos + 2] == 1)
    7.           {
    8.             assert(pos >= 0 && pos <= tsPacket.Length - 9, "PESDECODER: pos " + pos + " would cause an IndexOutOfBounds exception!");
    9.             int streamId = tsPacket[pos + 3];
    10.  
     
    • Thank You! Thank You! x 2
  4. te3hpurp
    • Premium Supporter

    te3hpurp Retired Team Member

    Joined:
    September 23, 2008
    Messages:
    904
    Likes Received:
    182
    Gender:
    Male
    Occupation:
    Senior Software Architect
    Location:
    Rovaniemi
    Ratings:
    +229 / 0
    Home Country:
    Finland Finland
    Show System Specs
    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,
     
    • Like Like x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!