Ticket #4902: still_frame_not_shown_4902.diff

File still_frame_not_shown_4902.diff, 8.6 KB (added by skamithi, 18 years ago)
  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    10221022                                video_disp_dim.height()));
    10231023    m_scan_locked  = false;
    10241024    m_scan_tracker = (m_scan == kScan_Interlaced) ? 2 : 0;
     1025   
     1026    if (ringBuffer->InDVDMenuOrStillFrame())
     1027        ringBuffer->DVD()->SetRunSeekCellStart(true);
    10251028}
    10261029
    10271030void NuppelVideoPlayer::SetFileLength(int total, int frames)
  • libs/libmythtv/avformatdecoder.cpp

     
    413413      lastdvdtitle(-1), lastcellstart(0),
    414414      decodeStillFrame(false),
    415415      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)
    418417{
    419418    bzero(&params, sizeof(AVFormatParameters));
    420419    bzero(audioSamples, AVCODEC_MAX_AUDIO_FRAME_SIZE * sizeof(short int));
     
    446445        delete pkt;
    447446    }
    448447
    449     if (lastDVDStillFrame)
    450         av_free_packet(lastDVDStillFrame);
    451 
    452448    CloseContext();
    453449    delete ccd608;
    454450    delete ccd708;
     
    30423038            else
    30433039            {
    30443040                storevideoframes = false;
    3045                 int numVidFrames = 0;
    3046                 if (GetNVP() && GetNVP()->getVideoOutput())
    3047                     numVidFrames = GetNVP()->getVideoOutput()->ValidVideoFrames();
     3041               
    30483042                bool inDVDStill = ringBuffer->DVD()->InStillFrame();
    30493043
    30503044                if (decodeStillFrame && !inDVDStill)
    3051                 {
    30523045                    decodeStillFrame = false;
    3053                 }
     3046               
     3047                if (inDVDStill)
     3048                    ringBuffer->DVD()->RunSeekCellStart();
    30543049
    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;
    30753052            }         
    30763053            if (GetNVP()->AtNormalSpeed() &&
    30773054                ((lastcellstart != cellstart) || (lastdvdtitle != dvdtitle)))
     
    37683745                    gotvideo = 1;
    37693746                    framesPlayed++;
    37703747
    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)
    37783749                        decodeStillFrame = false;
    3779                     }
    37803750
    37813751                    lastvpts = temppts;
    37823752                    break;
  • libs/libmythtv/DVDRingBuffer.cpp

     
    4444      buttonExists(false), cellid(0),
    4545      lastcellid(0), vobid(0),
    4646      lastvobid(0), cellRepeated(false),
    47       buttonstreamid(0), gotoCellStart(false),
     47      buttonstreamid(0), runningCellStart(false),
     48      runSeekCellStart(false),
    4849      menupktpts(0), curAudioTrack(0),
    4950      curSubtitleTrack(0), autoselectaudio(true),
    5051      autoselectsubtitle(true),
     
    120121    {
    121122        VERBOSE(VB_PLAYBACK, LOC_ERR +
    122123                QString("Seek() to time %1 failed").arg(time));
     124        return -1;
    123125    }
    124     else if (!IsInMenu() && !gotoCellStart)
     126    else if (!IsInMenu() && !runningCellStart)
    125127    {
    126128        gotStop = false;
    127129        if (time > 0 && ffrewSkip == 1)
     
    307309                            .arg(title).arg(part).arg(titleParts));
    308310
    309311                buttonSelected = false;
    310                 if (gotoCellStart)
     312                if (runningCellStart)
    311313                {
    312314                    lastvobid = lastcellid = 0;
    313                     gotoCellStart = false;
     315                    runningCellStart = false;
    314316                }
    315317                else
    316318                {
     
    356358                subTrackMap.clear();
    357359                uint count = dvdnav_subp_get_stream_count(dvdnav);
    358360
    359                 ClearMenuSPUParameters();
     361                //ClearMenuSPUParameters();
     362                if (parent)
     363                    parent->HideDVDButton(true);
     364
    360365                ClearSubtitlesOSD();
    361366
    362367                if (IsInMenu())
     
    550555
    551556                ClearSubtitlesOSD();
    552557
    553                 if (parent && buttonExists && NumMenuButtons() > 0)
     558                if (parent && buttonExists)
    554559                    parent->HideDVDButton(false);
    555560
    556561                if (blockBuf != dvdBlockWriteBuf)
     
    12921297    return false;
    12931298}
    12941299
     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 */
     1304void 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
    12951320/** \brief seek the beginning of a dvd cell
    12961321 */
    1297 void DVDRingBufferPriv::SeekCellStart(void)
     1322bool DVDRingBufferPriv::SeekCellStart(void)
    12981323{
    12991324    QMutexLocker lock(&seekLock);
    1300     gotoCellStart = true;
    1301     Seek(cellStart);
     1325    runningCellStart = true;
     1326    return (Seek(cellStart) == 0);
    13021327}
    13031328
    13041329/** \brief set dvd speed. uses the DVDDriveSpeed Setting from the settings
  • libs/libmythtv/DVDRingBuffer.h

     
    7575    int GetCellID(void) { return cellid; }
    7676    int GetVobID(void)  { return vobid; }
    7777    bool IsSameChapter(int tmpcellid, int tmpvobid);
     78    void RunSeekCellStart(void);
    7879
    7980    // commands
    8081    bool OpenFile(const QString &filename);
     
    105106    int   GetTrack(uint type);
    106107    uint8_t GetNumAudioChannels(int id);
    107108    void JumpToTitle(bool change) { jumptotitle = change; }
    108     void SeekCellStart(void);
    109109    void SetDVDSpeed(void);
    110110    void SetDVDSpeed(int speed);
     111    void SetRunSeekCellStart(bool change) { runSeekCellStart = change; }
    111112
    112113    void SetParent(NuppelVideoPlayer *p) { parent = p; }
    113114
     
    156157    int            lastvobid;
    157158    bool           cellRepeated;
    158159    int            buttonstreamid;
    159     bool           gotoCellStart;
     160    bool           runningCellStart;
     161    bool           runSeekCellStart;
    160162    long long      menupktpts;
    161163    int            curAudioTrack;
    162164    int8_t         curSubtitleTrack;
     
    188190    uint ConvertLangCode(uint16_t code);
    189191    void SelectDefaultButton(void);
    190192    void ClearSubtitlesOSD(void);
     193    bool SeekCellStart(void);
    191194
    192195    int get_nibble(const uint8_t *buf, int nibble_offset);
    193196    int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
  • libs/libmythtv/avformatdecoder.h

     
    278278    bool dvd_video_codec_changed;
    279279    bool dvdTitleChanged;
    280280    bool mpeg_seq_end_seen;
    281     /// \brief contains last dvd still frame decoded
    282     AVPacket *lastDVDStillFrame;
    283281};
    284282
    285283#endif