Ticket #5749: t5749_storedpackets_verbose3.diff
File t5749_storedpackets_verbose3.diff, 5.1 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/avformatdecoder.cpp
439 439 { 440 440 while (storedPackets.count() > 0) 441 441 { 442 VERBOSE(VB_PLAYBACK, QString("AFD::~AvFormatDecoder: flushing %1 stored video pkts") 443 .arg(storedPackets.count())); 442 444 AVPacket *pkt = storedPackets.first(); 443 445 storedPackets.removeFirst(); 444 446 av_free_packet(pkt); … … 639 641 if (doflush) 640 642 { 641 643 lastapts = 0; 644 VERBOSE(VB_PLAYBACK, 645 QString("lastapts = %1 in SeekReset").arg(lastapts)); 642 646 lastvpts = 0; 643 647 lastccptsu = 0; 644 648 av_read_frame_flush(ic); … … 673 677 // Free up the stored up packets 674 678 while (storedPackets.count() > 0) 675 679 { 680 VERBOSE(VB_PLAYBACK, QString("AFD::SeekReset: flushing %1 stored video pkts") 681 .arg(storedPackets.count())); 676 682 AVPacket *pkt = storedPackets.first(); 677 683 storedPackets.removeFirst(); 678 684 av_free_packet(pkt); … … 2350 2356 2351 2357 if (changed) 2352 2358 { 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 2353 2368 GetNVP()->SetVideoParams(width, height, seqFPS, 2354 2369 keyframedist, aspect, 2355 2370 kScan_Detect); … … 2364 2379 gopset = false; 2365 2380 prevgoppos = 0; 2366 2381 lastapts = lastvpts = lastccptsu = 0; 2382 VERBOSE(VB_PLAYBACK, 2383 QString("lastapts = %1 in MpegPreProcessPkt").arg(lastapts)); 2367 2384 2368 2385 // fps debugging info 2369 2386 float avFPS = normalized_fps(stream, context); … … 2439 2456 gopset = false; 2440 2457 prevgoppos = 0; 2441 2458 lastapts = lastvpts = lastccptsu = 0; 2459 VERBOSE(VB_PLAYBACK, 2460 QString("lastapts = %1 in H264PreProcessPkt").arg(lastapts)); 2442 2461 2443 2462 // fps debugging info 2444 2463 float avFPS = normalized_fps(stream, context); … … 3086 3105 } 3087 3106 } 3088 3107 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)); 3089 3111 if (gotvideo) 3090 3112 { 3091 if ( lowbuffers && onlyvideo == 0 &&3092 lastapts < lastvpts + 100 &&3113 if (!onlyvideo && 3114 lastapts < lastvpts + 200 && 3093 3115 lastapts > lastvpts - 10000 && 3094 3116 !ringBuffer->InDVDMenuOrStillFrame()) 3095 3117 { 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())); 3097 3120 storevideoframes = true; 3098 3121 } 3099 3122 else if (onlyvideo >= 0) … … 3105 3128 3106 3129 if (!storevideoframes && storedPackets.count() > 0) 3107 3130 { 3131 VERBOSE(VB_PLAYBACK, QString("AFD::GetFrame: taking one stored video pkt (%1)") 3132 .arg(storedPackets.count())); 3108 3133 if (pkt) 3109 3134 { 3110 3135 av_free_packet(pkt); … … 3228 3253 { 3229 3254 av_dup_packet(pkt); 3230 3255 storedPackets.append(pkt); 3256 VERBOSE(VB_PLAYBACK, QString("AFD::GetFrame: storing video pkt (%1)") 3257 .arg(storedPackets.count())); 3231 3258 pkt = NULL; 3232 3259 continue; 3233 3260 } … … 3441 3468 } 3442 3469 3443 3470 if (firstloop && pkt->pts != (int64_t)AV_NOPTS_VALUE) 3471 { 3444 3472 lastapts = (long long)(av_q2d(curstream->time_base) * 3445 3473 pkt->pts * 1000); 3474 VERBOSE(VB_PLAYBACK, 3475 QString("lastapts = %1 in GetFrame1").arg(lastapts)); 3476 } 3446 3477 3447 3478 if ((onlyvideo > 0) || (pkt->stream_index != audIdx)) 3448 3479 { … … 3522 3553 lastapts += (long long)((double)(data_size * 1000) / 3523 3554 (curstream->codec->channels * 2) / 3524 3555 curstream->codec->sample_rate); 3556 VERBOSE(VB_PLAYBACK, 3557 QString("lastapts = %1 in GetFrame2").arg(lastapts)); 3525 3558 3526 3559 VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, 3527 3560 LOC + QString("audio timecode %1 %2 %3 %4")