Ticket #6602: ringbuffer_reset_v2.diff

File ringbuffer_reset_v2.diff, 2.8 KB (added by Mark.Buechler@…, 15 years ago)

Disregard original, it was incomplete.

  • libs/libmythtv/recorderbase.cpp

     
    241241        rb_changed = true;
    242242
    243243        StartNewFile();
     244
     245        ResetStreamParser();
    244246    }
    245247    nextRingBufferLock.unlock();
    246248
  • libs/libmythtv/mpegrecorder.h

     
    6363    // ReaderPausedCB
    6464    virtual void ReaderPaused(int fd) { pauseWait.wakeAll(); }
    6565
     66    // Reset stream parsers when necessary
     67    virtual void ResetStreamParser(void);
     68
    6669  private:
    6770    void SetIntOption(RecordingProfile *profile, const QString &name);
    6871    void SetStrOption(RecordingProfile *profile, const QString &name);
  • libs/libmythtv/recorderbase.h

     
    212212     */
    213213    virtual void CheckForRingBufferSwitch(void);
    214214
     215    /** \brief Inherited method for the stream parser to be reset after
     216               a ringbuffer change. Used mainly in mpegrecorder for H264Parser.
     217     */
     218    virtual void ResetStreamParser(void) { };
     219
    215220    /** \brief Save the seektable to the DB
    216221     */
    217222    void SavePositionMap(bool force = false);
  • libs/libmythtv/mpegrecorder.cpp

     
    14301430    {
    14311431        VERBOSE(VB_RECORD, LOC + "PauseAndWait unpause");
    14321432
    1433         if (driver == "hdpvr")
    1434         {
    1435             m_h264_parser.Reset();
    1436             _wait_for_keyframe_option = true;
    1437             _seen_sps = false;
    1438         }
     1433        ResetStreamParser();
    14391434
    14401435        // Some drivers require streaming to be disabled before
    14411436        // an input switch and other channel format setting.
     
    15001495
    15011496    if (ioctl(fd, VIDIOC_ENCODER_CMD, &command) == 0)
    15021497    {
    1503         if (driver == "hdpvr")
    1504         {
    1505             m_h264_parser.Reset();
    1506             _wait_for_keyframe_option = true;
    1507             _seen_sps = false;
    1508         }
     1498        ResetStreamParser();
    15091499
    15101500        VERBOSE(VB_RECORD, LOC + "Encoding started");
    15111501        return true;
     
    17621752        SetBitrate(bitrate, maxbitrate, "New");
    17631753    }
    17641754}
     1755
     1756void MpegRecorder::ResetStreamParser(void)               
     1757{       
     1758    if (driver == "hdpvr")     
     1759    {
     1760        m_h264_parser.Reset();
     1761        _wait_for_keyframe_option = true;
     1762        _seen_sps = false;
     1763    }
     1764
     1765    RecorderBase::ResetStreamParser();
     1766}