**********

 CutterFF

**********

version 1.3 (Jul 13 2024)
-----------

* gui.c
    + in 'cff_gui_file_selection_new_gettext' the
      filechooser gets a combo-box for selecting a
      hwaccel. A tooltip shows available decoders
    + in 'cff_gui_file_save' a tooltip shows the
      available (but disabled) encoders

* ffmpeg.c
    + works with FFmpeg version 7.0
    + memory leak in 'cff_ffmpeg_program_open',
      'vframe.tmppkt' only unrefed, not freed. Now
      this is okay, see below
    + in 'cff_ffmpeg_file_open' the temporary packet
      and frames were allocated once, avoids allocating
      and freeing them in other functions
    + added 'vframe.has_keyframe', which is set in
      'cff_ffmpeg_get_frame_dts'. If no keyframe was
      found, I-Frames was treated as keyframes.
    + if in 'cff_ffmpeg_get_frame_dts' a frame with
      no (unknown) picture type will return an error
    + in function 'cff_ffmpeg_get_frame' entering
      'drain_mode' and storing the packet data (dts+pos)
      in 'video->vframe.pktlist' have been changed.
      Also rewind and searching again if the first
      packet after seeking has not at least a distance
      of seven frames to the next frame was removed
    + function 'cff_ffmpeg_copy_softcut_position_index'
      was removed in CutterFF-1.1, now it's back
    + decoding 'vp9' with multi-threading wasn't working.
      Setting the frame-type to 'slice' works.
    + encoding 'mpeg2' fails due invalid timebase. Fixed!
    + flushing the encoder in 'cff_ffmpeg_copy_softcut'
      was removed
    + removed 'kCFFStreamFlagBsfInit', copying the
      parameters from bsf to codec already done in
      'cff_ffmpeg_copy_open'
    + in 'cff_ffmpeg_get_bitstream_filter_names' the
      filter is only shown if the stream has a codec
      for it
    + saving a cut list adds 'LastFrame', this is the
      dts of the last video frame. Needed if loading
      with a different decoder to calculate the offset
    + the function 'cff_ffmpeg_get_encoder_names' returns
      a negative value if encoding should be disabled

* gprop.c
    + added item 'kPropStrFileHWAccel'

version 1.2.1 (Oct 21 2023)
-------------

* gui.c
    + running under GTK-4 'gtk_widget_set_size_request'
      needed in 'cff_gui_dialog_progress_bar', else
      the progressbar will not displayed in full width

* ffmpeg.c
    + may crash if opening a short video with less than
      'kCFFOpenFileGetLastFrame' (six) GOPs (in general
      a length of only a few seconds). After quit or
      open another video may then double free
      'video->vframe.drain', which was allocated in
      'cff_ffmpeg_get_frame_dts' and freed in
      'cff_ffmpeg_file_open_cb' without settting this
      variable to 'NULL'. Fixed!
    + the function 'cff_ffmpeg_get_encoder_names'
       > returns 0 if only the first frame should encoded,
	 and this is a keyframe and therefore should only
	 copied
       > if the stream has no information about the pixel
         format, try to get it from the decoder context
    + if 'cff_ffmpeg_encoder_new' finds no information
      about width, height or pixel format in the input
      stream,, try to get it from the decoder context
    + function 'cff_ffmpeg_file_open' with the structure
      'cff_fname_t' as parameter for filenames in local
      and UTF-8. Also a function pointer for freeing
      these strings may set ('free' vs. 'g_free').

version 1.2 (Jun 24 2023)
-----------

* gui.c
    + if running under GTK-3 and Wayland opening a file
      will freeze CutterFF. Replacing G_PRIORITY_HIGH
      with G_PRIORITY_HIGH_IDLE in 'cff_gui_thread_wait'
      will fix this!
    + filechooser now listening to the RETURN key
    + new checkbutton 'ts_adjust' for adjusting broken
      timestamps in 'cff_gui_build_media_option'

* ffmpeg.c
    + works with FFmpeg version 6.0
    + removed 'fopen' and 'av_fopen_utf8' (which is
      deprecated since 6.0) in
      'cff_ffmpeg_video_cut_list_save' and '.. _load'
    + if in 'cff_ffmpeg_get_frame_dts' the duration of
      the frame is <= 0, the displayed number of total
      frames is too high. Fixed!
    + in 'cff_ffmpeg_copy_cb' wrong message 'encoding
      start frame disabled' (only in 1.1). Fixed!
    + new flag 'kCFFStreamFlagTsAdjust' for adjusting
      broken timestamps
    + renamed 'st->pkt_dts' to 'st->pktdts_next'
    + in 'cff_ffmpeg_copy_softcut' substract 'dts_offset'
      from 'st->pktdts_next'

* main.c
    + option for setting the max number of threads, or
      disabling multi-threading.

version 1.1 (Mar 25 2023)
-----------

* GTK-4 (min 4.6.0) is now supported. Since GTK-4 has
  changed a lot, almost all files where updated.
  The filechooser widget was put in an own dialog
  Converting the filename between utf8 and local charset
  is now done using GFile
  Getting file infos like 'is directory', 'file exists'
  or 'file is equal' is also done using GFile
  Some widgets (e.g. GtkContainer, GtkMenu) and some
  functions (e.g. gtk_dialog_run, gtk_main) where gone,
  which needs (less or more) extra programming
  However, GTK-4 (tested with 4.6.0) is buggy, and the
  filechooser (in save mode) is really annoying

* gui.c
    + in 'cff_gui_save_optionmenu_callback' replacing
      the extension fails if filename has special
      characters. Position is in characters, not bytes.
    + replaced 'BUILD_MINGW' with 'G_OS_WIN32'

* ffmpeg.c
    + in 'cff_ffmpeg_find_codec' removed flags 'low_delay'
    + in 'cff_ffmpeg_encoder_new' removed flags 'cgop'
      and flags2 'noout'
    + counting b-frames in 'cff_ffmpeg_get_frame_dts'
    + softcut decoding/encoding using now dts
    + memory leak in 'cff_ffmpeg_copy_softcut' if option
      'both gops' is enabled

* main.c
    + use 'g_build_filename' for config file
    + converting commandline charset to 'utf8' with
      'g_win32_get_command' (WIN32 only)

* tools-gtk.c
    + function 'cff_tl_replace_non_utf8_chars_in_str'
      replaces 'non_ascii_chars'
    + function 'cff_tl_file_is_equal' tests whether input
      and output are equal (symlink or hardlink)

version 1.0.2 (Jul 09 2022)
-------------

* gui.c
    + changed in 'cff_gui_dialog_progress_callback'
      Gui_PRIORITY_REDRAW to G_PRIORITY_HIGH_IDLE
    + changed in 'cff_gui_logwindow_add_timeout'
      G_PRIORITY_HIGH to GTK_TEXT_VIEW_PRIORITY_VALIDATE
    + if the first character of the log string is '\r',
      the last line will be overwritten (Last message
      repeated x times). See 'cff_gui_logwindow_mainthread'
      and 'cff_gui_logwindow_cb'

* ffmpeg.c
    + works with FFmpeg version 5.0.1
    + in 'cff_ffmpeg_get_image_format_names' looking
      for the codec_id (TIFF, GIF ...) if the encoder
      has not the mime type 'image'
    + test in 'cff_ffmpeg_get_encoder_names' whether
      the encoder supports the pixel format of the input
    + removed in 'cff_ffmpeg_encoder_new' the options
      for 'b-frames', 'gop' and 'sc_threshold'
    + in 'cff_ffmpeg_copy_softcut' forgot to free the
      frame if packet allocation fails
    + 'level &= 0x00FF' in 'cff_ffmpeg_log_callback'
    + get the parent class in 'cff_ffmpeg_log_callback'
      with 'avr' may crash. Right way is using 'ptr'
    + 'skip_prefix' in 'cff_ffmpeg_log_callback' to
      append the next string to the current
    + compare the string in 'cff_ffmpeg_log_callback'
      to the previous one. If equal throw the message
      "Last message repeated x times"
    + some improvements in'cff_ffmpeg_get_frame' for
      proper decoding. Sometimes a frame may report a
      wrong picture type, or a key frame which is not
      at this position, or the frame is not correct
      displayed.

* ffmpeg.h
    + including 'libavcodec/bsf.h' (FFmpeg 5.0.1)

version 1.0.1 (Sep 04 2021)
-------------

* gui.c
    + if encoding (softcut enabled) has finished, the
      text in the progressbar may not disappear. Fixed!

* ffmpeg.c
    + if saving a file with softcut more than once the
      automatic enabling of 'h264_mp4toannexb' or
      'hevc_mp4toannexb' fails. Fixed!
    + in 'cff_ffmpeg_copy_write_frame_softcut' the PTS
      assignment may wrong, 'pts -= pts_diff' followed
      by 'pts = pptr->dts'. Fixed!
    + 'av_packet_int' replaced with 'av_packet_alloc'
    + 'av_packet_ref' replaced with 'av_packet_clone'

version 1.0 (Jul 31 2021)
-----------

* main.c
    + replaced 'GLIB_MAJOR_VERSION' with
      'GLIB_MINOR_VERSION' and 'glib_major_version'
      with 'glib_minor_version'

* gui.c
    + setting '-GtkMenuBar-shadow-type' only for
      versions < 3.20 (GTK-3 only)
    + if closing a file with unsaved cutpoints a
      dialog asks for discarding changes
    + replaced in 'cff_gui_css_load_from_data'
      'gtk_style_context_add_provider_for_screen'
      with 'gtk_style_context_add_provider'
    + changed priority in 'cff_gui_logwindow_color_set'
      from 'GTK_STYLE_PROVIDER_PRIORITY_APPLICATION' to
      '..._USER' (GTK-3 only)
    + changed tag color and font in 'textview' to
        GTK-2 'gtk_widget_modify_...' or
        GTK-3 'cff_gui_css_load_from_data'
    + in 'cff_gui_logwindow_color_parse' converting
      'rgb(r,g,b)' to '#rrggbb' (GTK-2 only)
    + popup in 'cff_gui_file_save' for selecting the
      encoder for soft cutting
    + may hang if log was set to 'debug'. So
      'g_main_context_invoke_full' in 'cff_gui_logwindow_cb'
      was removed, 'cff_gui_logwindow_mainthread' is now
      called every 5ms using 'g_timeout_add_full'
    + remove last '\n' from log string in 'cff_gui_logwindow_cb'
    + '_textview_scroll_to_iter' in 'cff_gui_logwindow_cb'
      was removed. Now down scrolling is done using the
      signal 'changed', and setting the new value in
      'cff_gui_logwindow_adjustment' with the function
      'gtk_adjustment_set_value'
    + the slider is now 'GtkScale'
    + using 'Cairo' instead of 'GdkDraw' (GTK-2 only)

* ffmpeg.c
    + 'cff_ffmpeg_print_codecs_for_id': codecs separated
      by commas, last space in front of terminating ')'
      removed
    + softcut is de- and encoding frames at the cutpoint(s)
    + stream-sync starts copying packets if the timestamp
      is greater or equal than the cutpoint
    + test if bitstream filter 'mp4toannexb' is needed for
      encoding in 'cff_ffmpeg_get_frame_dts' (h.264 + h.265)
    + 'cff_ffmpeg_copy_open': if 'avformat_transfer_internal_
      stream_timing_info' failed, try '(st->oStream)->time_
      base = (st->iStream)->time_base' before 'av_stream_get_
      codec_timebase'
    + if the first DVB subtitle frame should clear a subtitle,
      it is dropped (no subtitle shown yet). This will also
      compute the right stream duration

* tools-gtk.c
    + renamed 'guitl_' to 'cff_guitl_'
    + moved 'cff_gui_beep' to 'cff_guitl_beep'
    + 'cff_guitl_window_destroy' sets 'gWindata.topwin'
      to NULL, if the main window is not on the top
    + 'cff_guitl_dialog_icon' sets 'gWindata.topwin' to
      'gWindata.mainwin', is the top window is NULL
    + changed signal 'size-allocate' in 'cff_guitl_window_setup'
      to 'configure-event'

version 0.9 (Aug 03 2019)
-----------

* gui.c
    + if Num-Lock is activated, depending on the OS and
      GUI no navigation may possible. Now the functions
      only breaks if the Control-key is pressed.
    + 'cff_gui_video_frame_button' is the right button
      equal to the shift key.

* ffmpeg.c
    + 'cff_ffmpeg_get_stream_from_index' may return wrong
      or no streams, if the file contains more than one
      program, and some without a video stream. Fixed!
    + the frame duration computed from 'ticks_per_second'
      may sometimes too short. Fixed!
    + flushing the codec in 'cff_ffmpeg_file_open_cb' if
      seeking for the last frame of the video
    + DVB subtitles should work now
    + if 'avcodec_receive_frame' fails, rewind only if
      the packet flag 'AV_PKT_FLAG_DISCARD' is not set
    + decoding starts now always with a keyframe, if not
      seeking the first fame
    + storing the packet position for first frame, needed
      if the dts is not set
    + copy the video if first cutpoint is the first frame
      may fail if the dts is not set. Fixed!
    + cutpoints will now be saved with the values frame-dts,
      packet-dts and packet-position. It is possible to
      load lists stored with previous versions of CutterFF.

version 0.8 (Mar 16 2019)
-----------

* gui.c
    + memory leak in 'cff_gui_init', 'logname' may not
      be freed. Fixed!
    + memory leak in 'cff_gui_save_image',
      'filechooser_utf8str' may not be freed. Fixed!
    + max 10 extensions (file filter) can be added for
      the filechooser
    + if copying to another format the matching extension
      is now appended to the filename

* ffmpeg.c
    + memory leak in 'cff_ffmpeg_copy_cb', 'bsf_ctx' may
      not be freed. Fixed!
    + videos could not loaded if the frames have a duration
      of zero. Fixed!
    + videos may not loaded by some muxers if the first
      packet is not a key frame. Fixed!
    + if copying to another format (especially to AVI) the
      timestamps may incorrect. Fixed!
    + 'cff_ffmpeg_get_format_names' now returns only the
      formats useable for the available streams
    + 'cff_ffmpeg_get_bitstream_filter_names' now returns
      only the filters useable for the available streams
    + 'cff_ffmpeg_get_outformat_extension' returns the ex-
      tension for the given format

version 0.7 (Jan 25 2019)
-----------

* gui.c
    + memory leak in 'cff_gui_save_start', 'format_names'
      may not be freed. Fixed!
    + disable menu entry File->Save if there is only one
      cut point, which is the last frame
    + image dialog for saving an image
    + disable okay-button if in the saving dialogs the entry
      field is empty

* ffmpeg.c
    + buffer may too small for displaying all codecs or
      formats. Fixed!
    + may compute wrong display aspect ratio. Fixed!
    + new function 'cff_ffmpeg_printf_concat' (re)allocates
      memory and writing the string to it
    + log-window displays "Repeated last message n times",
      if the same message should be displayd more then two
      times
    + scale, encode and save an image
    + at end of copying the bitstream filters will be flushed
    + flushing the codec at end of stream may not work since
      the decode timestamps (dts) are not set. These missing
      values will now computed and saved while opening a file
    + replaced deprecated functions (FFmpeg version 4.0.2)

version 0.6 (Dec 22 2018)
-----------

* gui.c
    + save dialog with option for shortest stream duration
    + memory leak in 'cff_gui_save_start', 'bsf_info' may not
      be freed. Fixed!
    + removed double question for overwriting an existing file
    + if copying the log-window to the clipboard it will be
      converted from UNIX to DOS (LF to CRLF)
      (MINGW and GTK-2 only)

* ffmpeg.c
    + searching to previous frame may fail, if the current
      position is near the last frame and K/I/P-frame is
      requested. Fixed!
    + if at label '_got_picture' the condition 'last_frame != NULL'
      is true, the assignment 'video->vframe.packet[0].pos = -1'
      may overwrite the packet position which was found. Fixed!
    + searching one frame forward or backward may skip a frame
      with a duration less than the picture duration. Fixed!
    + the written file may too short if the duration of
      either audio or video is shorter than the other stream.
      The option 'shortest' was always active, now the user
      may choose if this should happen.
    + may hang if clicking twice on the slider at the same
      position. Fixed!
    + tiny memory leak in 'cff_ffmpeg_get_frame_dts'. Fixed!
    + flushing the codec at end of stream

version 0.5 (Nov 03 2018)
-----------

* gui.c
    + memory leak  in 'cff_gui_logwindow_cb'. Fixed!
    + now it is possible to close the log-window while
      opening a video file as long as the progressbar is
      not visible
    + using an extra thread for opening a video file while
      the progressbar is not visible, which speeds up
      displaying FFmpeg messages in the log-window
    + mutex for the progress-bar

* ffmpeg.c
    + adding a semaphore if closing the log-window while
      logging is active
    + searching the last frame may fail, if K/I/P-frame is
      requested. Fixed!
    + copying a file do not clear the dirty flag for the
      cutlist

* macros-gtk.h
    + 'GuiRecMutex' to 'GuiMutex'

version 0.4.2 (Aug 11 2018)
-------------

* gui.c
    + since GTK+ version 3.22.30 the window will not be
      proper drawn after start, but when changing the size
      of the window everything works fine. Testing the cairo
      surface pointer in the redraw functions and create a
      surface if the pointer is NULL fix this bug!
    + removed depricated functions 'gtk_color_button_get_rgb'
      and 'gtk_scrolled_window_add_with_viewport', since the
      required GTK+ version is min 3.10. (GTK-3 only)

* ffmpeg.c
    + works with FFmpeg version 4.0.2

version 0.4.1 (Jul 07 2018)
-------------

* gui.c
    + may hang in 'cff_gui_dialog_progress_callback' when
      finished saving a video. Calling 'g_main_context_wakeup'
      at the end of the function seems to fix this bug!

version 0.4 (Jun 09 2018)
-----------

* gui.c
    + on 'quit' the main-window will be closed, but the
      log-window may stay open, and the program will
      not shutdown. Fixed!
    + file open, program open, save and seeking for a
      frame runs in an extra thread
    + log-window with a dialog for choosing colors for
      text and background (right mouse button)

* ffmpeg.c
    + may crash on 'cff_ffmpeg_video_cut_list_clear' if
      video->cut.num == 0. Fixed!
    + if displaying the last frame and seeking one frame
      back may fail. Fixed! 
    + 'cff_ffmpeg_video_cut_add_dts'
        back to 'src->frame < src->packet'

version 0.3 (Apr 14 2018)
-----------

* gui.c
    + log window displaying FFmpeg messages

* ffmpeg.c
    + callback for FFmpeg messages
    + copying till the end of file may end with the error
      'av_read_frame failed'. Now really fixed!
      'cff_ffmpeg_read_packet'
        replaced 'avio_feof(pb) == 0 ||
          avio_tell(pb) < video->vframe.io_seek_end'
	with 'avio_feof(pb) != 0 ||
          avio_tell(pb) >= video->vframe.io_seek_end'
    + 'cff_ffmpeg_video_cut_add_dts'
        replaced 'src->frame < src->packet'
	with 'src->frame <= src->packet'


version 0.2 (Mar 24 2018)
-----------

* gui.c
    + check menu items for 'Key-frame' and 'I-frame' show
      wrong setting (either menu or popupmenu). Fixed!
    + save dialog with tabs, selection for bitstreamfilters
      and duration separate for video, audio and other
    + put the first video and audio stream into output list
    + submenu for displaying cutpoints
    + option for deleting the copy if an error occurs

* ffmpeg.c
    + if copying then the last cutpoint (which is the last
      stop and means copy till end) will be overwritten
      with a wrong dts. Fixed!
    + if juming to a cutpoint (previous/next/goto) the
      settings for Key/I/P-Frame will be ignored
    + copying till the end of file may end with the error
      'av_read_frame failed'. Fixed!
    + add the packet duration before rescaling
    + Undo and Redo for adding/removing cutpoints
    + add a cutpoint depends on value of 'has_b_frames':
        0)    frame != packet
        else) frame >  packet
    + add a cutpoint is only possible if neither frame
      nor packet exist in the list
    + a cutpoint can only deleted (the '-' button in
      'cf_gui.c' is enabled) if both frame and packet
      do exist
    + option for seeking P-frames
    + better decoding HEVC (waiting for first key-frame)
    + compute frame duration from 'ticks_per_second' with 
      stream (time) and context (fps) 'time_base'
    + saving with options 'duration' and 'bitstreamfilter'
      for Video, Audio and Other


version 0.1 (Dec 29 2017)
-----------

First release

/* EOF */
