Ticket #5749: t5749_storedpackets_verbose3.diff

File t5749_storedpackets_verbose3.diff, 5.1 KB (added by gigem, 17 years ago)
  • libs/libmythtv/avformatdecoder.cpp

     
    439439{
    440440    while (storedPackets.count() > 0)
    441441    {
     442        VERBOSE(VB_PLAYBACK, QString("AFD::~AvFormatDecoder: flushing %1 stored video pkts")
     443                .arg(storedPackets.count()));
    442444        AVPacket *pkt = storedPackets.first();
    443445        storedPackets.removeFirst();
    444446        av_free_packet(pkt);
     
    639641    if (doflush)
    640642    {
    641643        lastapts = 0;
     644        VERBOSE(VB_PLAYBACK,
     645                QString("lastapts = %1 in SeekReset").arg(lastapts));
    642646        lastvpts = 0;
    643647        lastccptsu = 0;
    644648        av_read_frame_flush(ic);
     
    673677        // Free up the stored up packets
    674678        while (storedPackets.count() > 0)
    675679        {
     680            VERBOSE(VB_PLAYBACK, QString("AFD::SeekReset: flushing %1 stored video pkts")
     681                    .arg(storedPackets.count()));
    676682            AVPacket *pkt = storedPackets.first();
    677683            storedPackets.removeFirst();
    678684            av_free_packet(pkt);
     
    23502356
    23512357            if (changed)
    23522358            {
     2359// Heisenbug and/or race condition?
     2360#if 1
     2361                VERBOSE(VB_PLAYBACK,
     2362                        QString("seqFPS = %1, fps = %2 in MpegPreProcessPkt").arg(seqFPS).arg(fps));
     2363                VERBOSE(VB_PLAYBACK,
     2364                        QString("width = %1, cur.width = %2 in MpegPreProcessPkt").arg(width).arg((uint)current_width));
     2365                VERBOSE(VB_PLAYBACK,
     2366                        QString("height = %1, cur.height = %2 in MpegPreProcessPkt").arg(height).arg((uint)current_height));
     2367#endif
    23532368                GetNVP()->SetVideoParams(width, height, seqFPS,
    23542369                                         keyframedist, aspect,
    23552370                                         kScan_Detect);
     
    23642379                gopset = false;
    23652380                prevgoppos = 0;
    23662381                lastapts = lastvpts = lastccptsu = 0;
     2382                VERBOSE(VB_PLAYBACK,
     2383                        QString("lastapts = %1 in MpegPreProcessPkt").arg(lastapts));
    23672384
    23682385                // fps debugging info
    23692386                float avFPS = normalized_fps(stream, context);
     
    24392456            gopset = false;
    24402457            prevgoppos = 0;
    24412458            lastapts = lastvpts = lastccptsu = 0;
     2459            VERBOSE(VB_PLAYBACK,
     2460                    QString("lastapts = %1 in H264PreProcessPkt").arg(lastapts));
    24422461
    24432462            // fps debugging info
    24442463            float avFPS = normalized_fps(stream, context);
     
    30863105            }
    30873106        }
    30883107
     3108        VERBOSE(VB_PLAYBACK, QString("gotvideo: %1, pts diff: %2, lastvpts: "
     3109                                     "%3, lastapts: %4").arg(gotvideo)
     3110                .arg(lastvpts-lastapts).arg(lastvpts).arg(lastapts));
    30893111        if (gotvideo)
    30903112        {
    3091             if (lowbuffers && onlyvideo == 0 &&
    3092                 lastapts < lastvpts + 100 &&
     3113            if (!onlyvideo &&
     3114                lastapts < lastvpts + 200 &&
    30933115                lastapts > lastvpts - 10000 &&
    30943116                !ringBuffer->InDVDMenuOrStillFrame())
    30953117            {
    3096                 //cout << "behind: " << lastapts << " " << lastvpts << endl;
     3118                VERBOSE(VB_PLAYBACK, QString("Audio is %1 ms behind, queuing video pkts (%2)")
     3119                        .arg(lastvpts-lastapts).arg(storedPackets.count()));
    30973120                storevideoframes = true;
    30983121            }
    30993122            else if (onlyvideo >= 0)
     
    31053128
    31063129        if (!storevideoframes && storedPackets.count() > 0)
    31073130        {
     3131            VERBOSE(VB_PLAYBACK, QString("AFD::GetFrame: taking one stored video pkt (%1)")
     3132                    .arg(storedPackets.count()));
    31083133            if (pkt)
    31093134            {
    31103135                av_free_packet(pkt);
     
    32283253        {
    32293254            av_dup_packet(pkt);
    32303255            storedPackets.append(pkt);
     3256            VERBOSE(VB_PLAYBACK, QString("AFD::GetFrame: storing video pkt (%1)")
     3257                    .arg(storedPackets.count()));
    32313258            pkt = NULL;
    32323259            continue;
    32333260        }
     
    34413468                    }
    34423469
    34433470                    if (firstloop && pkt->pts != (int64_t)AV_NOPTS_VALUE)
     3471                    {
    34443472                        lastapts = (long long)(av_q2d(curstream->time_base) *
    34453473                                               pkt->pts * 1000);
     3474                        VERBOSE(VB_PLAYBACK,
     3475                                QString("lastapts = %1 in GetFrame1").arg(lastapts));
     3476                    }
    34463477
    34473478                    if ((onlyvideo > 0) || (pkt->stream_index != audIdx))
    34483479                    {
     
    35223553                    lastapts += (long long)((double)(data_size * 1000) /
    35233554                                (curstream->codec->channels * 2) /
    35243555                                curstream->codec->sample_rate);
     3556                    VERBOSE(VB_PLAYBACK,
     3557                            QString("lastapts = %1 in GetFrame2").arg(lastapts));
    35253558
    35263559                    VERBOSE(VB_PLAYBACK|VB_TIMESTAMP,
    35273560                            LOC + QString("audio timecode %1 %2 %3 %4")