Ticket #6922: h264_stream_check_v3.diff
| File h264_stream_check_v3.diff, 3.1 KB (added by markk, 2 years ago) |
|---|
-
libs/libmythtv/videoout_vdpau.h
105 105 106 106 uint m_decoder; 107 107 int m_pix_fmt; 108 uint64_t m_decoder_description; 109 bool m_force_reinit; 108 110 109 111 int m_frame_delay; 110 112 QMutex m_lock; -
libs/libmythtv/videoout_vdpau.cpp
27 27 m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone), 28 28 m_checked_surface_ownership(false), 29 29 m_checked_output_surfaces(false), 30 m_decoder(0), m_pix_fmt(-1), m_frame_delay(0), 30 m_decoder(0), m_pix_fmt(-1), m_decoder_description(0), 31 m_force_reinit(false), m_frame_delay(0), 31 32 m_lock(QMutex::Recursive), m_pip_layer(0), m_pip_surface(0), 32 33 m_pip_ready(false), 33 34 m_osd_layer(0), m_osd_surface(0), m_osd_output_surface(0), … … 130 131 m_decoder = 0; 131 132 m_render = NULL; 132 133 m_pix_fmt = -1; 134 m_decoder_description = 0; 133 135 } 134 136 135 137 bool VideoOutputVDPAU::InitBuffers(void) … … 481 483 m_checked_surface_ownership = true; 482 484 } 483 485 486 #define HASH_H264(arg) \ 487 ((uint64_t)arg.num_ref_frames << 56) + \ 488 ((uint64_t)arg.mb_adaptive_frame_field_flag << 48) 489 484 490 void VideoOutputVDPAU::DrawSlice(VideoFrame *frame, int x, int y, int w, int h) 485 491 { 486 492 (void)x; … … 505 511 return; 506 512 } 507 513 514 if (frame->pix_fmt == PIX_FMT_VDPAU_H264 && 515 frame->pix_fmt == m_pix_fmt && m_decoder && 516 HASH_H264(render->info.h264) != m_decoder_description) 517 { 518 VERBOSE(VB_IMPORTANT, LOC + 519 QString("h264 stream type has changed.")); 520 VERBOSE(VB_PLAYBACK, LOC + QString("Old desc '%1'") 521 .arg(m_decoder_description, 16, 16, QChar(48))); 522 VERBOSE(VB_PLAYBACK, LOC + QString("New desc '%1'") 523 .arg(HASH_H264(render->info.h264), 16, 16, QChar(48))); 524 m_force_reinit = true; 525 InputChanged(windows[0].GetVideoDispDim(), windows[0].GetVideoAspect(), 526 m_codec_id, NULL); 527 } 528 508 529 if (frame->pix_fmt != m_pix_fmt) 509 530 { 510 531 if (m_decoder) … … 518 539 uint max_refs = 2; 519 540 if (frame->pix_fmt == PIX_FMT_VDPAU_H264) 520 541 { 542 m_decoder_description = HASH_H264(render->info.h264); 521 543 max_refs = render->info.h264.num_ref_frames; 522 544 if (max_refs < 1 || max_refs > 16) 523 545 { … … 619 641 bool res_changed = input_size != windows[0].GetVideoDispDim(); 620 642 bool asp_changed = aspect != windows[0].GetVideoAspect(); 621 643 644 if (m_force_reinit) 645 { 646 VERBOSE(VB_IMPORTANT, LOC + QString("Forcing reinit.")); 647 cid_changed = true; 648 m_force_reinit = false; 649 } 650 622 651 if (!res_changed && !cid_changed) 623 652 { 624 653 if (asp_changed)
