Ticket #4902: still_frame_not_shown_4902.diff
| File still_frame_not_shown_4902.diff, 8.6 KB (added by , 18 years ago) |
|---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
1022 1022 video_disp_dim.height())); 1023 1023 m_scan_locked = false; 1024 1024 m_scan_tracker = (m_scan == kScan_Interlaced) ? 2 : 0; 1025 1026 if (ringBuffer->InDVDMenuOrStillFrame()) 1027 ringBuffer->DVD()->SetRunSeekCellStart(true); 1025 1028 } 1026 1029 1027 1030 void NuppelVideoPlayer::SetFileLength(int total, int frames) -
libs/libmythtv/avformatdecoder.cpp
413 413 lastdvdtitle(-1), lastcellstart(0), 414 414 decodeStillFrame(false), 415 415 dvd_xvmc_enabled(false), dvd_video_codec_changed(false), 416 dvdTitleChanged(false), mpeg_seq_end_seen(false), 417 lastDVDStillFrame(NULL) 416 dvdTitleChanged(false), mpeg_seq_end_seen(false) 418 417 { 419 418 bzero(¶ms, sizeof(AVFormatParameters)); 420 419 bzero(audioSamples, AVCODEC_MAX_AUDIO_FRAME_SIZE * sizeof(short int)); … … 446 445 delete pkt; 447 446 } 448 447 449 if (lastDVDStillFrame)450 av_free_packet(lastDVDStillFrame);451 452 448 CloseContext(); 453 449 delete ccd608; 454 450 delete ccd708; … … 3042 3038 else 3043 3039 { 3044 3040 storevideoframes = false; 3045 int numVidFrames = 0; 3046 if (GetNVP() && GetNVP()->getVideoOutput()) 3047 numVidFrames = GetNVP()->getVideoOutput()->ValidVideoFrames(); 3041 3048 3042 bool inDVDStill = ringBuffer->DVD()->InStillFrame(); 3049 3043 3050 3044 if (decodeStillFrame && !inDVDStill) 3051 {3052 3045 decodeStillFrame = false; 3053 } 3046 3047 if (inDVDStill) 3048 ringBuffer->DVD()->RunSeekCellStart(); 3054 3049 3055 if (numVidFrames == 0 && inDVDStill) 3056 { 3057 if (lastDVDStillFrame) 3058 { 3059 VERBOSE(VB_PLAYBACK, LOC + "DVD: in still frame but " 3060 "there is no picture. Using last stored still " 3061 "frame"); 3062 storedPackets.append(lastDVDStillFrame); 3063 ringBuffer->DVD()->SeekCellStart(); 3064 lastDVDStillFrame = NULL; 3065 decodeStillFrame = true; 3066 } 3067 else 3068 ringBuffer->DVD()->SeekCellStart(); 3069 } 3070 else 3071 { 3072 if (storedPackets.count() < 2 && !decodeStillFrame) 3073 storevideoframes = true; 3074 } 3050 if (storedPackets.count() < 2 && !decodeStillFrame) 3051 storevideoframes = true; 3075 3052 } 3076 3053 if (GetNVP()->AtNormalSpeed() && 3077 3054 ((lastcellstart != cellstart) || (lastdvdtitle != dvdtitle))) … … 3768 3745 gotvideo = 1; 3769 3746 framesPlayed++; 3770 3747 3771 if (ringBuffer->InDVDMenuOrStillFrame() && decodeStillFrame) 3772 { 3773 if (lastDVDStillFrame) 3774 av_free_packet(lastDVDStillFrame); 3775 av_dup_packet(pkt); 3776 lastDVDStillFrame = pkt; 3777 pkt = NULL; 3748 if (decodeStillFrame) 3778 3749 decodeStillFrame = false; 3779 }3780 3750 3781 3751 lastvpts = temppts; 3782 3752 break; -
libs/libmythtv/DVDRingBuffer.cpp
44 44 buttonExists(false), cellid(0), 45 45 lastcellid(0), vobid(0), 46 46 lastvobid(0), cellRepeated(false), 47 buttonstreamid(0), gotoCellStart(false), 47 buttonstreamid(0), runningCellStart(false), 48 runSeekCellStart(false), 48 49 menupktpts(0), curAudioTrack(0), 49 50 curSubtitleTrack(0), autoselectaudio(true), 50 51 autoselectsubtitle(true), … … 120 121 { 121 122 VERBOSE(VB_PLAYBACK, LOC_ERR + 122 123 QString("Seek() to time %1 failed").arg(time)); 124 return -1; 123 125 } 124 else if (!IsInMenu() && ! gotoCellStart)126 else if (!IsInMenu() && !runningCellStart) 125 127 { 126 128 gotStop = false; 127 129 if (time > 0 && ffrewSkip == 1) … … 307 309 .arg(title).arg(part).arg(titleParts)); 308 310 309 311 buttonSelected = false; 310 if ( gotoCellStart)312 if (runningCellStart) 311 313 { 312 314 lastvobid = lastcellid = 0; 313 gotoCellStart = false;315 runningCellStart = false; 314 316 } 315 317 else 316 318 { … … 356 358 subTrackMap.clear(); 357 359 uint count = dvdnav_subp_get_stream_count(dvdnav); 358 360 359 ClearMenuSPUParameters(); 361 //ClearMenuSPUParameters(); 362 if (parent) 363 parent->HideDVDButton(true); 364 360 365 ClearSubtitlesOSD(); 361 366 362 367 if (IsInMenu()) … … 550 555 551 556 ClearSubtitlesOSD(); 552 557 553 if (parent && buttonExists && NumMenuButtons() > 0)558 if (parent && buttonExists) 554 559 parent->HideDVDButton(false); 555 560 556 561 if (blockBuf != dvdBlockWriteBuf) … … 1292 1297 return false; 1293 1298 } 1294 1299 1300 /** \brief runs SeekCellStart() once video resolution/codec change occurs. 1301 ** ffmpeg for some reason doesnt' output menu spu if seekcellstart 1302 ** is started too soon after a video codec/resolution change 1303 */ 1304 void DVDRingBufferPriv::RunSeekCellStart(void) 1305 { 1306 bool ret = true; 1307 int numButtons = NumMenuButtons(); 1308 if (numButtons > 0 && !buttonExists) 1309 ret = false; 1310 if (ret && runSeekCellStart) 1311 { 1312 VERBOSE(VB_PLAYBACK, LOC + 1313 QString("RunSeekCellStart() Menu Button Count %1 Menu Button exists %2") 1314 .arg(numButtons).arg(buttonExists)); 1315 ret = SeekCellStart(); 1316 runSeekCellStart = false; 1317 } 1318 } 1319 1295 1320 /** \brief seek the beginning of a dvd cell 1296 1321 */ 1297 voidDVDRingBufferPriv::SeekCellStart(void)1322 bool DVDRingBufferPriv::SeekCellStart(void) 1298 1323 { 1299 1324 QMutexLocker lock(&seekLock); 1300 gotoCellStart = true;1301 Seek(cellStart);1325 runningCellStart = true; 1326 return (Seek(cellStart) == 0); 1302 1327 } 1303 1328 1304 1329 /** \brief set dvd speed. uses the DVDDriveSpeed Setting from the settings -
libs/libmythtv/DVDRingBuffer.h
75 75 int GetCellID(void) { return cellid; } 76 76 int GetVobID(void) { return vobid; } 77 77 bool IsSameChapter(int tmpcellid, int tmpvobid); 78 void RunSeekCellStart(void); 78 79 79 80 // commands 80 81 bool OpenFile(const QString &filename); … … 105 106 int GetTrack(uint type); 106 107 uint8_t GetNumAudioChannels(int id); 107 108 void JumpToTitle(bool change) { jumptotitle = change; } 108 void SeekCellStart(void);109 109 void SetDVDSpeed(void); 110 110 void SetDVDSpeed(int speed); 111 void SetRunSeekCellStart(bool change) { runSeekCellStart = change; } 111 112 112 113 void SetParent(NuppelVideoPlayer *p) { parent = p; } 113 114 … … 156 157 int lastvobid; 157 158 bool cellRepeated; 158 159 int buttonstreamid; 159 bool gotoCellStart; 160 bool runningCellStart; 161 bool runSeekCellStart; 160 162 long long menupktpts; 161 163 int curAudioTrack; 162 164 int8_t curSubtitleTrack; … … 188 190 uint ConvertLangCode(uint16_t code); 189 191 void SelectDefaultButton(void); 190 192 void ClearSubtitlesOSD(void); 193 bool SeekCellStart(void); 191 194 192 195 int get_nibble(const uint8_t *buf, int nibble_offset); 193 196 int decode_rle(uint8_t *bitmap, int linesize, int w, int h, -
libs/libmythtv/avformatdecoder.h
278 278 bool dvd_video_codec_changed; 279 279 bool dvdTitleChanged; 280 280 bool mpeg_seq_end_seen; 281 /// \brief contains last dvd still frame decoded282 AVPacket *lastDVDStillFrame;283 281 }; 284 282 285 283 #endif
