All pastes #1927388 Raw Edit

Someone

public text v1 · immutable
#1927388 ·published 2010-08-28 05:34 UTC
rendered paste body
Index: libs/libmythtv/avformatdecoder.cpp
===================================================================
--- libs/libmythtv/avformatdecoder.cpp	(revision 25881)
+++ libs/libmythtv/avformatdecoder.cpp	(working copy)
@@ -2950,6 +2950,12 @@
         }
         else
         {
+            if (pkt->pts != (int64_t)AV_NOPTS_VALUE)
+                context->reordered_opaque = (int64_t)(av_q2d(curstream->time_base) * pkt->pts * 100000000000);
+            else
+                context->reordered_opaque = 0;
+            VERBOSE(VB_PLAYBACK+VB_TIMESTAMP, LOC +
+                QString("private_dec pkt->pts %1 context->reordered_opaque %2").arg(pkt->pts).arg(context->reordered_opaque));
             ret = private_dec->GetFrame(context, &mpa_pic, &gotpicture, pkt);
         }
     }
@@ -3070,6 +3076,7 @@
     }
     pts = (long long)(av_q2d(curstream->time_base) * pts * 1000);
 
+    pts = (long long)(mpa_pic.reordered_opaque / 100000);
     long long temppts = pts;
 
     // Validate the video pts against the last pts. If it's
Index: libs/libmythtv/privatedecoder_crystalhd.cpp
===================================================================
--- libs/libmythtv/privatedecoder_crystalhd.cpp	(revision 25881)
+++ libs/libmythtv/privatedecoder_crystalhd.cpp	(working copy)
@@ -372,7 +372,9 @@
 
     // TODO check for busy state and available buffer size
     INIT_ST
-    st = DtsProcInput(m_device, buf, size, pkt->pts * 1000, false);
+    st = DtsProcInput(m_device, buf, size, avctx->reordered_opaque, false);
+    //st = DtsProcInput(m_device, buf, size, pkt->pts * 1000, false);
+    //st = DtsProcInput(m_device, buf, size, 0, false);
     CHECK_ST
 
     if (free_buf)
@@ -536,10 +538,14 @@
             found = true;
             break;
         }
+        VERBOSE(VB_IMPORTANT, ERR +
+                QString("AddFrameToQueue :: m_frame-> timecode %1 m_decoded_frames[%2] timecode %3")
+                .arg(m_frame->timecode).arg(i).arg(m_decoded_frames[i]->timecode));
     }
     if (!found)
         i = m_decoded_frames.size();
-    m_decoded_frames.insert(i, m_frame);
+    //m_decoded_frames.insert(i, m_frame);
+    m_decoded_frames.insert(0, m_frame);
     m_frame = NULL;
 }