Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FFmpeg to version 7.1 #950

Open
wants to merge 73 commits into
base: master
Choose a base branch
from

Commits on Oct 11, 2024

  1. libavformat/demux.c: remove errant doxygen comment

    It was originally for a different function av_destruct_packet_nofree:
    MythTV@bf432d9#diff-4b6a432208acd44651f07cdde943169aba8c5611b26a83764ad784d00c250f7fR899
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    a8a6f92 View commit details
    Browse the repository at this point in the history
  2. Revert "fix non UTF-8 files (external)"

    This reverts commit 049fabc.
    
    Reduce changes to FFmpeg.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    5fedd4b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d672b5b View commit details
    Browse the repository at this point in the history
  4. use ffnvcodec/dynlink_loader.h directly

    Instead of the internal FFmpeg header compat/cuda/dynlink_loader.h.  This leaves
    only one internal FFmpeg header used by MythTV.
    
    Per the comment on win32_dlopen() in FFmpeg/compat/w32dlfcn.h, Windows will now
    additionally search the current directory for nvcuda.dll and nvcuvid.dll, which
    FFmpeg considers less secure.
    
    This is an atomic block and the order must be preserved:
     #include "libavutil/log.h"
     #define FFNV_LOG_FUNC(logctx, msg, ...) av_log(logctx, AV_LOG_ERROR, msg,  __VA_ARGS__)
     #define FFNV_DEBUG_LOG_FUNC(logctx, msg, ...) av_log(logctx, AV_LOG_DEBUG, msg,  __VA_ARGS__)
     #include <ffnvcodec/dynlink_loader.h>
    
     #include "libavutil/hwcontext_cuda.h"
    must come after
     #include <ffnvcodec/dynlink_cuda.h>
    which is also transitively included by #include <ffnvcodec/dynlink_loader.h>
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    c1a38bc View commit details
    Browse the repository at this point in the history
  5. Revert "ffmpeg: Add required cast to w32dlfcn.h"

    This reverts commit 5f9b27c.
    
    MythTV no longer uses that file, so remove the modification.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    ecc68d8 View commit details
    Browse the repository at this point in the history
  6. convert use of internal libavformat/url.h to public libavformat/avio.…

    …h (part 1)
    
    Since we don't need the full buffer, we could use avio_read_partial() instead.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    6f1df71 View commit details
    Browse the repository at this point in the history
  7. avformatdecoder.h: remove undefined functions

    Originally from 2003:
    MythTV@ec136a9
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    674876e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    68f38dd View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9909343 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a4cb2e1 View commit details
    Browse the repository at this point in the history
  11. convert use of internal libavformat/url.h to public libavformat/avio.…

    …h (part 3)
    
    I don't know if any of this is necessary since FFmpeg's avio API is already
    buffered.  However, I did not investigate using avio directly with avio_open()
    nor did I investigate what our buffer actually does.
    
    I'm not sure why MythAVFormatBuffer::Seek() with Whence = SEEK_END did not ever
    actually seek.
    
    libavformat/avio.h says this about read_packet:
    "
    A function for refilling the buffer, may be NULL.
    For stream protocols, must never return 0 but rather
    a proper AVERROR code.
    "
    
    So I'm not sure the first return of 0 was correct.  AVERROR(EINVAL) is a more
    useful return value for all of the functions, instead of 0.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    ca9f8b9 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f7229b3 View commit details
    Browse the repository at this point in the history
  13. libavformat/mpegts-mythtv.c: constify AVInputFormats

    They are const in mpegts.c.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    23da227 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a8ef2f2 View commit details
    Browse the repository at this point in the history
  15. mpegts-mythtv.h: remove unused added defines

    The only STREAM_TYPE_* define used is STREAM_TYPE_PRIVATE_DATA.
    
    STREAM_TYPE_AUDIO_DTS is already defined by FFmpeg to a different value.  0x8a
    is used in MISC_types[].
    
    STREAM_TYPE_AUDIO_HDMV_* defines are from:
    MythTV@d15e482
    They are now unused and FFmpeg has added the entries to HDMV_types[].
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    b1bf592 View commit details
    Browse the repository at this point in the history
  16. mpegts-mythtv.h: remove unused added STREAM_TYPE_*_DVB defines

    STREAM_TYPE_SUBTITLE_DVB is from:
    MythTV@aaa9372#diff-ae852538fd61b663231c8bdda1fdbade40c97e8305401fcc6f1ad9f395efdf18
    STREAM_TYPE_VBI_DVB is from:
    MythTV@6da1854
    
    However, the corresponding uses in MISC_types[] can never be used.
    in mpegts_set_stream_info()
        pes->stream_type = stream_type;
    ...
            mpegts_find_stream_type(st, pes->stream_type, MISC_types);
    
    mpegts_set_stream_info() is called either with stream_type = 0 or
    stream_type = get8(&p, p_end)
    
    0x100 and 0x101 exceed UINT8_MAX and thus will never be found in the search.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    0a450b0 View commit details
    Browse the repository at this point in the history
  17. mpegts-mythtv: update DVB defines

    Use the names given in ETSI 300 468 and list all of the values used,
    even if the defines aren't.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    92eaa46 View commit details
    Browse the repository at this point in the history
  18. mpegts-mythtv.h: rename DVB_CAROUSEL_ID

    I'm not sure that the new name is correct since I don't have a copy of
    ISO/IEC 13818-6.  However, it should be close.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    d06016d View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    13e8d89 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    620a263 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    761f1e3 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    a4146dc View commit details
    Browse the repository at this point in the history
  23. mpegts-mythtv.h: remove unused MAX_PES_PAYLOAD

    Appears to have been from an FFmpeg merge in 2009:
    MythTV@6d62e66
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    67d1cf9 View commit details
    Browse the repository at this point in the history
  24. mpegts-mythtv.c: remove customization to parsing of subtitling_descri…

    …ptor
    
    This has no functional change since MythTV only uses the MythTV addition
    AVStream::carousel_id if AVStream::codecpar::codec_id == AV_CODEC_ID_DSMCC_B.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    218b1f5 View commit details
    Browse the repository at this point in the history
  25. mpegts-mythtv.c: pat_cb(): ensure all PIDs are valid

    originally from:
    MythTV@a1d4d11
    referencing:
    https://code.mythtv.org/trac/ticket/1887
    
    ISO/IEC 13818-1:2021 specifies a valid range of [0x0010, 0x1FFE] in
    § 2.4.4.6 Semantic definition of fields in program association section
    and Table 2-3 – PID table
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    3df4b45 View commit details
    Browse the repository at this point in the history
  26. mpegts-mythtv.c: remove customizations MpegTSContext::req_sid, scanni…

    …ng, and pmt_scan_state
    
    req_sid is from an FFmpeg merge:
    MythTV@2a56a37#diff-2fb8a33ba832f242d27f19c9f25755b57af9807343e99dac77263c1c5ebc383a
    removed from FFmpeg in
    FFmpeg/FFmpeg@90d13e3
    
    scanning and pmt_scan_state are from
    MythTV@084e3f8
    
    MpegTSContext::req_sid is only set by mpegts_read_header().
    
    First, in pmt_cb() always create PMT filters.
    Now we don't want to stop_parse early since that would prevent creating all the
    PMT filters, so remove those changes to pat_cb() and pmt_cb().
    
    MpegTSContext::pmt_scan_state is only tested in mpegts_read_header() and its use
    is equivalent to `!ts->prg[i].pmt_found`.
    
    Now MpegTSContext::scanning and MpegTSContext::pmt_scan_state are unused, so
    remove them.
    
    MpegTSContext::req_sid is now set but otherwise unused, so remove it as well.
    
    Additionally, in mpegts_read_header() sid would cause an invalid index of -1 on
    the first iteration.
    
    The fallback code in mpegts_read_header() has been broken since
    MythTV@0b0068c
    
    sid != pmt_pid, so it was looking for the wrong filter in MpegTSContext::pids.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    4935a09 View commit details
    Browse the repository at this point in the history
  27. mpegts-mythtv.c: remove fallback code from mpegts_read_header()

    Disabling CRC is from:
    MythTV@084e3f8
    referencing
    https://code.mythtv.org/trac/ticket/328
    
    However, the sample does not trigger that fallback.
    
    Deal with incomplete PMT streams in BBC iPlayer IPTV
    MythTV@c11ee69
    references
    https://code.mythtv.org/trac/ticket/9926
    
    The sample is unavailable and the issue was not in FFmpeg's unmodified demuxer,
    so, following subsequent harmonization, I assume it is no longer an issue.  If
    it still is, MythTV's other modifications should be looked at first.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    1f51832 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    5fd023b View commit details
    Browse the repository at this point in the history
  29. mpegts-mythtv.c: replace pmt_equal_streams() with is_pmt_equal()

    There is one PMT per program, so add the stream_type to the corresponding
    Program.  This means we no longer need to look at an MpegTSFilter.  The
    searching logic in is_pmt_equal() is equivalent to that in pmt_equal_streams().
    However, we now look at the entire PMT not just is_desired_stream()s.
    
    Nothing now uses MpegTSContext::pid_cnt or MpegTSContext::pmt_pids, so remove
    them and a lot of other now unused code.
    
    See ISO/IEC 13818-1:2021 § 2.4.4.9 Program map table
    Perhaps we could use TS_program_map_section()'s version_number and possibly
    current_next_indicator instead of comparing the PMT ourselves?  Maybe by
    modifying update_av_program_info()?
    
    export_pmt() would probably need
    if (old_version == -1 || old_version != version)
    also its buffer should probably be moved to AVProgram since each program has a
    different PMT.
    
    Similarly streams_changed() should have a program_number parameter, since we
    probably only care about one program at a time.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    285de4a View commit details
    Browse the repository at this point in the history
  30. AvFormatDecoder: ensure audio streams match the video stream

    This can be a problem when there is more than one program in one file, e.g.
    a full TS capture with multiple digital subchannels.
    
    The `#if`ed out log in AutoSelectAudioTrack was broken; I replaced it with
    something that should be similar.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    7632571 View commit details
    Browse the repository at this point in the history
  31. create AvFormatDecoder::autoSelectVideoTrack from ScanStreams()

    This is clearer than the infinite loop with breaks (effectively gotos).
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    77aa927 View commit details
    Browse the repository at this point in the history
  32. move pmt_section to AVProgram

    This is a MythTV addition that exports the PMT from an MPEG-TS.  However, each
    program has its own PMT so having a single pmt_section in AVFormatContext is not
    correct when there are multiple programs in the stream.  Previously, each PMT
    overwrote the last one.
    
    Adapt AvFormatDecoder to look in AVProgram.
    
    In my limited testing, the PMT did not seem necessary for ATSC captions.
    
    MythAVBufferRef: Satisfy the rule of five; however, since nullptr is now
    allowed, the newly defined constructors and operators are unused.  The compiler
    generated ones were causing use after free segmentation faults.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    fc482bb View commit details
    Browse the repository at this point in the history
  33. add avprogram_id to streams_changed() callback

    This is an int to match type with AVProgram.  In mpegts.c, SectionHeader::id is
    a uint16_t as ISO/IEC 13818-1:2021 specifies for program_number.
    
    This allows us to ignore stream changes in programs that are not being watched
    when there is more than one program.
    
    Regarding the changes to mpeg.c:
    Originally from:
    dvb/ac3 patches 1, 2, and 3 from Mark Anderson
    MythTV@87795f6
    
    changed in:
    Refs #8134. internal dvd player. resolve problem where pcm_s16be audi…
    MythTV@e64371a
    
    change reverted in:
    Refs #8134. revert most of [24239]. Anduin withers reported it makes …
    MythTV@a3d6e14
    
    referencing: #8134 (internal dvd player: pcm_s16be improperly detected as pcm_dvd audio codec.) – MythTV
    https://code.mythtv.org/trac/ticket/8134
    
    An MPEG Program Stream can only have one program, so FFmpeg does not create an
    AVProgram for it.  Thus av_find_program_from_stream() (and therefore
    get_current_AVProgram()) will always return nullptr, so avprogram_id will be
    ignored.
    
    The calling conventions of functions with "C" and "C++" language linkage are not
    necessarily the same; however, in practice they are, so
    AvFormatDecoder::streams_changed() could be used directly.  Doing it correctly
    still eliminates the use of a friend function and its double declaration at only
    the cost of an extra function call, which doesn't matter since streams_changed()
    is only called very rarely.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    25d5f20 View commit details
    Browse the repository at this point in the history
  34. mpegts-mythtv.c: remove is_pmt_equal()

    by using the PMT's version_number (and current_next_indicator) to determine when
    to call streams_changed().  (FFmpeg already checks the current_next_indicator
    in pmt_cb() before the call to update_av_program_info().)
    
    The only change is the first seen PMT for each program will now never call
    streams_changed().  is_pmt_equal() would return 0 for the first seen PMT for
    each program when opening the file, but streams_changed is null at that point.
    
    This may prevent a call to streams_changed() when a new PAT version adds a
    program.  However, MythTV does not fully support multiple programs in a single
    transport stream, so this is acceptable.  The new PAT may also remove the
    currently playing program, which the PMT code cannot detect.
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    403eb6e View commit details
    Browse the repository at this point in the history
  35. mpegts-mythtv.c: remove customization to add_pes_stream()

    It does nothing since pmt_cb() already closes the already existing filter before
    calling and the call in handle_packet() will only occur when
    `ts->pids[pid] == NULL`, i.e. there is no filter to close.
    
    It was originally from:
    PMT tracking in ffmpeg patch from danielk.
    MythTV@236872a
    ulmus-scott committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    83f917e View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2024

  1. Configuration menu
    Copy the full SHA
    6716364 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d271e34 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1304aee View commit details
    Browse the repository at this point in the history
  4. Use AVFrame::best_effort_timestamp

    instead of AVCodecContext::reordered_opaque and AVFrame::reordered_opaque, which
    have been removed and as far as I can tell were just passed around and unused
    by FFmpeg.
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    84c1781 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    976ab94 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f8928e8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    807ef79 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6c4c268 View commit details
    Browse the repository at this point in the history
  9. fix TestMusicMetadata::test_mp4()

    Uncommenting the dump() statement shows 3140ms.
    ffprobe version 6.1.1-3ubuntu5 also shows 3.14 seconds, so FFmpeg now thinks
    the file is 25ms shorter.
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    5098f34 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    383aca2 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    d43d574 View commit details
    Browse the repository at this point in the history
  12. replace deprecated av_fft API with av_tx

    also fixed a typo from 7a6b478,
    where the left channel was set to 0 twice instead of setting both
    the left and right value to 0.
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    93a9bc4 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    ae38250 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    7849f30 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    e4e850b View commit details
    Browse the repository at this point in the history
  16. remove DecoderBase::m_getRawFrames and m_getRawVideo

    They were only used by MythTranscodePlayer so move them there.
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    dc03e8d View commit details
    Browse the repository at this point in the history
  17. remove unused no-op functions from DecoderBase

    UpdateStoredFrameNum(), WriteStoredData(), ClearStoredData()
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    8f08f60 View commit details
    Browse the repository at this point in the history
  18. mythaverror: add new functions returning std::string

    and fix Doxygen syntax for other functions.
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    ca0e299 View commit details
    Browse the repository at this point in the history
  19. split libmyth/mythavframe.h from libmyth/mythaverror.h

    and eliminate unnecessary transitive includes of those files.
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    b22e19e View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    7fe6c88 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    31af3ce View commit details
    Browse the repository at this point in the history
  22. MythMediaBuffer::WaitForAvail(): simplify return logic

    The first return ensures (available < count) is always true.
    
    If m_ateof is true, then Count = available, which means (available < count) is
    false and all subsequent conditionals are false.
    
    Now, (available < count) is only needed for the while loop condition.
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    552e90b View commit details
    Browse the repository at this point in the history
  23. make macOS Video Toolbox code compile

    FFmpeg removed the used function and the recommendation was to use
    AVCodecContext.hw_frames_ctx or hw_device_ctx instead.  However,
    the code is already using those, so I don't know what it was supposed
    to be doing.
    ulmus-scott committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    6b17b01 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    6705a26 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2024

  1. Configuration menu
    Copy the full SHA
    9972ac7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    957e912 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3867022 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. Revert "lavf/utils.c: optimize avformat_find_stream_info()"

    This reverts commit db3dfa505a2a5a7e2b6ff898f9c3ad5d74fbf01a.
    
    I am not sure the "optimization" was correct and removing the customization
    appears to have no effect of any kind.  My MHEG sample did not trigger the log
    message for "All DSM info found".
    ulmus-scott committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    96d36a9 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2024

  1. AvFormatDecoder::DecodeCCx08(): remove dead code

    The code in libavcodec/mpeg12dec.c will never create a cc_type of 2 for SCTE-20
    and cc_type is guaranteed to be less than 2 otherwise by the if condition.
    
    AvFormatDecoder::m_invertScteField is now always 0, so remove it.
    
    AvFormatDecoder::m_lastScteField is now set but unused, so remove it.
    ulmus-scott committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    77a48fe View commit details
    Browse the repository at this point in the history
  2. libavcodec/mpeg12dec.c: reduce MythTV customization regarding closed …

    …captions
    
    see mpeg_decode_a53_cc()
    
    Differences:
    FFmpeg does not have the initial two bytes that MythTV added to signal valid and
    length.
    
    FFmpeg will only use the first type of embedded CC that it sees, whereas MythTV
    would switch between ATSC and SCTE-20 under certain conditions.  If multiple
    types were present MythTV would concatenate them.
    
    FFmpeg allows forcing the subtitle format with the cc_format option in mpeg12dec.c.
    
    DVD CC:
    FFmpeg does not check p[4]
    
    ATSC A/53:
    FFmpeg checks the process_cc_data_flag in p[5].
    
    SCTE-20:
    FFmpeg ignores line_offset, which MythTV ensures is 11 for line 21 data.
    
    FFmpeg does not set one_bit or the 4 reserved bits before cc_valid and cc_type
    (cc608hdr vs cap[0]), but these are only to avoid emulating start codes and are
    not checked, so it doesn't matter.
    
    p[0] == 0x05 && p[1] == 0x02:
    Moved to mpeg_decode_a53_cc().
    
    Originally from:
    Fixes #2481, by applying patch from kenny at the-b org. This adds dec…
    MythTV@49d3294
    
    Referencing:
    https://code.mythtv.org/trac/ticket/2481
    
    Modified in:
    Simplify DTV CEA-608 handling a bit & add some range checking.
    MythTV@be6a2b4
    
    Some tweaks to cc implementation in mpeg12.c: make the C ANSI compati…
    MythTV@77cff32
    
    See also:
    https://github.com/CCExtractor/ccextractor/blob/master/src/lib_ccx/es_userdata.c
    
    MythTV:
    SCTE-20 encapsulates CTA-608, which is where XDS is defined, so I don't know why
    the condition was specific to SCTE-20.
    ulmus-scott committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    ebb54e3 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2024

  1. revert 'Fix how configure finds libxml2.'

    This reverts commit 641109a.
    
    David Hampton confirmed on the mailing list that this change is no longer
    necessary on FreeBSD 13/14/15.
    ulmus-scott committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    cf36d9b View commit details
    Browse the repository at this point in the history
  2. revert 'libavdevice/opengl_enc.c: EGL and GLES2 support (Patches for …

    …Android)'
    
    Neither header is checked by FFmpeg's configure and neither HAVE_EGL_EGL_H
    nor HAVE_GLES2_GL2_H is defined.  FFmpeg/configure has not tested those since
    MythTV@018be3f
    in 2018.
    
    FFmpeg's configure never tested eglGetProcAddress and thus would never define
    HAVE_EGLGETPROCADDRESS.
    
    MythTV's configure does check them and (myth)config.h does define HAVE_EGL_EGL_H,
    HAVE_GLES2_GL2_H, and HAVE_EGLGETPROCADDRESS; however, FFmpeg does not use
    mythconfig.h, using its own config.h instead, probably since the decoupling of
    MythTV and FFmpeg's configure in
    MythTV@9563786
    in 2018.
    ulmus-scott committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    72c879a View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2024

  1. Configuration menu
    Copy the full SHA
    a56f86d View commit details
    Browse the repository at this point in the history
  2. remove MythTV addition av_remove_stream()

    by merging the code into AvFormatDecoder::RemoveAudioStreams() and replacing
    ff_flush_packet_queue() with avformat_flush().
    
    The original code could have accessed out of bounds if the first stream was an
    audio stream, since i would have been -1 on the next iteration.  This would also
    cause it to recheck previously checked streams when a stream was removed.
    
    By setting the index first, we don't have to iterate twice to renumber the streams.
    
    Slightly more is reset by avformat_flush(), see libavformat/seek.c, compared to
    just ff_flush_packet_queue(), but it is a public function and resetting the
    extra values is probably better since it more fully resets the AVFormatContext.
    Additionally, the AVFormatContext is now only reset once instead of after
    removing each stream.
    ulmus-scott committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    f067464 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2024

  1. StreamInfo: clean up constructors

    StreamInfo::m_av_substream_index is only used for kTrackTypeAudio.  It is no
    longer set to 0 by:
    mythdvddecoder.cpp
    AvFormatDecoder::ScanStreams() for AVMEDIA_TYPE_SUBTITLE
    
    StreamInfo::m_orig_num_channels is only used by AvFormatDecoder::GetTrackDesc()
    to print the number of audio channels for kAudioTypeNormal.
    The following no longer set m_orig_num_channels to 0:
    mythdvddecoder.cpp
    cc708reader.cpp
    decoderbase.cpp
    avformatdecoder.cpp
    
    StreamInfo::m_easy_reader and m_wide_aspect_ratio were unused but set by:
    AvFormatDecoder::ScanATSCCaptionStreams() (incorrectly, setting
    m_orig_num_channels = easy_reader and m_easy_reader = wide_aspect_ratio)
    
    AvFormatDecoder::ScanStreams() for AVMEDIA_TYPE_AUDIO (appeared to set m_easy_reader
    in an unused attempt to flag the second StreamInfo for dual mono audio)
    
    decoderbase.cpp: I don't know why one of the default CC608 set m_language_index
    to 2, but it is not used for closed captions.
    ulmus-scott committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    4ff9a59 View commit details
    Browse the repository at this point in the history
  2. AvFormatDecoder::ScanStreams(): simplify adding audio tracks

    If continue is DVD specific and from
    MythTV@8bcef59
    
    AVStream::id will never be negative for MPEG-TS or MPEG-PS.
    ulmus-scott committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    4fbf18b View commit details
    Browse the repository at this point in the history
  3. remove StreamInfo::m_orig_num_channels

    It was a copy of a value from AVCodecParameters and was only used for printing.
    
    If the channel count from FFmpeg is wrong, add this to GetTrackDesc() to get the
    value from libdvdnav:
    
    if (m_ringBuffer->IsDVD())
        channels = m_ringBuffer->DVD()->GetNumAudioChannels(m_tracks[kTrackTypeAudio][TrackNo].m_stream_id);
    ulmus-scott committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    e726cf0 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2024

  1. change how MPEG audio dual mono is signaled

    When attempting to upstream the change before, it was recommended to instead
    use AV_CHANNEL_ORDER_CUSTOM with two AV_CHAN_FRONT_CENTER channels. See
    https://patchwork.ffmpeg.org/project/ffmpeg/patch/[email protected]/
    
    audiotoolboxdec.c will no longer flag dual_mono since it uses
    AV_CHANNEL_ORDER_UNSPEC.
    
    SetupAudioStreamSubIndexes() will create or destroy the second StreamInfo for
    the second substream, leaving the duplicate StreamInfo from ScanStreams()
    untouched, allowing playing both channels as stereo.
    ulmus-scott committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    fd66537 View commit details
    Browse the repository at this point in the history