Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Something
Thursday, October 20th, 2011 at 8:54:22pm MDT 

  1. diff --git a/mythtv/libs/libmythtv/dtvrecorder.cpp b/mythtv/libs/libmythtv/dtvrecorder.cpp
  2. index e0a5335..f852d5f 100644
  3. --- a/mythtv/libs/libmythtv/dtvrecorder.cpp
  4. +++ b/mythtv/libs/libmythtv/dtvrecorder.cpp
  5. @@ -82,6 +82,10 @@ DTVRecorder::DTVRecorder(TVRec *rec) :
  6.      memset(_stream_id, 0, sizeof(_stream_id));
  7.      memset(_pid_status, 0, sizeof(_pid_status));
  8.      memset(_continuity_counter, 0, sizeof(_continuity_counter));
  9. +    pc = new ParseContext1;
  10. +    memset(pc, 0, sizeof(struct ParseContext1));
  11. +    s = new AVCodecParserContext;
  12. +    memset(s, 0, sizeof(struct AVCodecParserContext));
  13.  }
  14.  
  15.  DTVRecorder::~DTVRecorder()
  16. @@ -101,6 +105,12 @@ DTVRecorder::~DTVRecorder()
  17.          delete _input_pmt;
  18.          _input_pmt = NULL;
  19.      }
  20. +
  21. +    if (pc)
  22. +    {
  23. +        delete pc;
  24. +        pc = NULL;
  25. +    }
  26.  }
  27.  
  28.  void DTVRecorder::SetOption(const QString &name, const QString &value)
  29. @@ -339,7 +349,6 @@ bool DTVRecorder::FindMPEG2Keyframes(const TSPacket* tspacket)
  30.      //   (there are others that we don't care about)
  31.      const uint8_t *bufptr = tspacket->data() + tspacket->AFCOffset();
  32.      const uint8_t *bufend = tspacket->data() + TSPacket::kSize;
  33. -    int progressive_sequence = 0;
  34.      int ext_type, bytes_left;
  35.      int picture_structure, top_field_first, repeat_first_field, progressive_frame;
  36.      int repeat_pict = 0;
  37. @@ -384,7 +393,7 @@ bool DTVRecorder::FindMPEG2Keyframes(const TSPacket* tspacket)
  38.                      case 0x1: /* sequence extension */
  39.                          if (bytes_left >= 6)
  40.                          {
  41. -                            progressive_sequence = bufptr[1] & (1 << 3);
  42. +                            pc->progressive_sequence = bufptr[1] & (1 << 3);
  43.                          }
  44.                          break;
  45.                      case 0x8: /* picture coding extension */
  46. @@ -399,7 +408,7 @@ bool DTVRecorder::FindMPEG2Keyframes(const TSPacket* tspacket)
  47.                              repeat_pict = 1;
  48.                              if (repeat_first_field)
  49.                              {
  50. -                                if (progressive_sequence)
  51. +                                if (pc->progressive_sequence)
  52.                                  {
  53.                                      if (top_field_first)
  54.                                          repeat_pict = 5;
  55. diff --git a/mythtv/libs/libmythtv/dtvrecorder.h b/mythtv/libs/libmythtv/dtvrecorder.h
  56. index 25b8c7e..721a669 100644
  57. --- a/mythtv/libs/libmythtv/dtvrecorder.h
  58. +++ b/mythtv/libs/libmythtv/dtvrecorder.h
  59. @@ -18,6 +18,10 @@ using namespace std;
  60.  #include "recorderbase.h"
  61.  #include "H264Parser.h"
  62.  
  63. +extern "C" {
  64. +#include "libavcodec/parser.h"
  65. +}
  66. +
  67.  class MPEGStreamData;
  68.  class TSPacket;
  69.  class QTime;
  70. @@ -132,6 +136,10 @@ class DTVRecorder :
  71.      unsigned int _video_bytes_remaining;
  72.      unsigned int _other_bytes_remaining;
  73.  
  74. +    // used for storing sequence header information
  75. +    ParseContext1        *pc;
  76. +    AVCodecParserContext *s;
  77. +
  78.      // H.264 support
  79.      bool _pes_synced;
  80.      bool _seen_sps;

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
fantasy-obligation