• Andreas Rheinhardt's avatar
    avformat/fifo_test: Move into tests/fifo_muxer.c · 41ab25cb
    Andreas Rheinhardt authored
    This muxer solely exists to test the fifo muxer via a dedicated
    test tool in libavformat/tests/fifo_muxer.c. It fulfills no
    other role and it is only designed with this role in mind.
    
    The latter can be seen in two facts: The muxer uses printf
    for logging and it simply presumes the packets' data to contain
    a FailingMuxerPacketData (a struct duplicated in fifo_test.c
    and tests/fifo_muxer.c.); in particular, it presumes packets
    to have data at all, but this need not be true with side-data
    only packets and a segfault can easily be triggered by e.g.
    encoding flac (our native encoder sends a side-data only packet
    with updated extradata at the end of encoding).
    
    This patch fixes this by moving the test muxer into the fifo
    test tool, making it inaccessible via the API (and actually
    removing it from libavformat.so and libavformat.a).
    While this muxer was accessible via e.g. av_guess_format(),
    it was not really usable for an API user as FailingMuxerPacketData
    was not public. Therefore this is not considered a breaking change.
    
    In order to continue to use the test muxer in the test tool,
    the ordinary fifo muxer had to be overridden: fifo_muxer.c
    includes lavf/fifo.c but with FIFO_TEST defined which makes
    it support the fifo_test muxer. This is possible because
    test tools are always linked statically to their respective
    library.
    Reviewed-by: 's avatarStefano Sabatini <stefasab@gmail.com>
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
    41ab25cb
allformats.c 26.9 KB