Ticket #9542: 102-fix_seconds_played.patch

File 102-fix_seconds_played.patch, 2.7 KB (added by Jiri Fojtasek <jiri.fojtasek@…>, 9 years ago)

the patch

  • libs/libmythtv/avformatdecoder.cpp

    diff -u -r -p mythtv.101/libs/libmythtv/avformatdecoder.cpp mythtv/libs/libmythtv/avformatdecoder.cpp
    old new bool AvFormatDecoder::ProcessVideoFrame( 
    29262926    picframe->interlaced_frame = mpa_pic->interlaced_frame;
    29272927    picframe->top_field_first  = mpa_pic->top_field_first;
    29282928    picframe->repeat_pict      = mpa_pic->repeat_pict;
    2929     picframe->disp_timecode    = NormalizeVideoTimecode(stream, temppts);
    29302929    picframe->frameNumber      = framesPlayed;
    29312930
    29322931    m_parent->ReleaseNextVideoFrame(picframe, temppts);
  • libs/libmythtv/frame.h

    diff -u -r -p mythtv.101/libs/libmythtv/frame.h mythtv/libs/libmythtv/frame.h
    old new typedef struct VideoFrame_ 
    3838
    3939    long long frameNumber;
    4040    long long timecode;
    41     int64_t   disp_timecode;
    4241
    4342    unsigned char *priv[4]; // random empty storage
    4443
  • libs/libmythtv/mythplayer.cpp

    diff -u -r -p mythtv.101/libs/libmythtv/mythplayer.cpp mythtv/libs/libmythtv/mythplayer.cpp
    old new MythPlayer::MythPlayer(bool muted) 
    201201      avsync_predictor(0),          avsync_predictor_enabled(false),
    202202      refreshrate(0),
    203203      lastsync(false),              repeat_delay(0),
    204       disp_timecode(0),
    205204      // Time Code stuff
    206205      prevtc(0),                    prevrp(0),
    207206      // LiveTVChain stuff
    void MythPlayer::AVSync(VideoFrame *buff 
    16521651    {
    16531652        repeat_pict   = buffer->repeat_pict;
    16541653        timecode      = buffer->timecode;
    1655         disp_timecode = buffer->disp_timecode;
    16561654    }
    16571655
    16581656    float diverge = 0.0f;
    void MythPlayer::calcSliderPos(osdInfo & 
    43484346        islive = true;
    43494347    }
    43504348
    4351     float secsplayed = (float)(disp_timecode / 1000.f);
     4349    float secsplayed = (float)(framesPlayed / video_frame_rate);
    43524350    calcSliderPosPriv(info, paddedFields, playbackLen, secsplayed, islive);
    43534351}
    43544352
  • libs/libmythtv/mythplayer.h

    diff -u -r -p mythtv.101/libs/libmythtv/mythplayer.h mythtv/libs/libmythtv/mythplayer.h
    old new class MPUBLIC MythPlayer 
    698698    bool       lastsync;
    699699    bool       decode_extra_audio;
    700700    int        repeat_delay;
    701     int64_t    disp_timecode;
    702701
    703702    // Time Code stuff
    704703    int        prevtc;        ///< 32 bit timecode if last VideoFrame shown