<commit_before>/* See COPYING file for copyright and license details. */

#include <libavformat/avformat.h>
#include <gmodule.h>

#include "ebur128.h"
#include "input.h"

#define BUFFER_SIZE (192000 + FF_INPUT_BUFFER_PADDING_SIZE)

static GStaticMutex ffmpeg_mutex = G_STATIC_MUTEX_INIT;

struct input_handle {
  AVFormatContext* format_context;
  AVCodecContext* codec_context;
  AVCodec* codec;
  AVFrame* frame;
  AVPacket packet;
  AVPacket orig_packet;
  int audio_stream;
  int flushing;
  int got_frame;
  int packet_left;
  float buffer[BUFFER_SIZE / 2 + 1];
};

static unsigned ffmpeg_get_channels(struct input_handle* ih) {
  return (unsigned) ih->codec_context->channels;
}<commit_msg>fix compile issue on input_ffmpeg<commit_after>/* See COPYING file for copyright and license details. */

#include <libavformat/avformat.h>
#if LIBAVCODEC_VERSION_MAJOR >= 53
# if LIBAVUTIL_VERSION_MAJOR > 52
#  include <libavutil/channel_layout.h>
# else
#  include <libavutil/audioconvert.h>
# endif
#endif
#include <gmodule.h>

#include "ebur128.h"
#include "input.h"

#define BUFFER_SIZE (192000 + FF_INPUT_BUFFER_PADDING_SIZE)

static GStaticMutex ffmpeg_mutex = G_STATIC_MUTEX_INIT;

struct input_handle {
  AVFormatContext* format_context;
  AVCodecContext* codec_context;
  AVCodec* codec;
  AVFrame* frame;
  AVPacket packet;
  AVPacket orig_packet;
  int audio_stream;
  int flushing;
  int got_frame;
  int packet_left;
  float buffer[BUFFER_SIZE / 2 + 1];
};

static unsigned ffmpeg_get_channels(struct input_handle* ih) {
  return (unsigned) ih->codec_context->channels;
}
{'fraction_non_alphanumeric': 0.09361163820366857, 'fraction_numerical': 0.01644528779253637, 'mean_word_length': 5.4048582995951415, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '238358', 'n_tokens_mistral': 592, 'n_tokens_neox': 564, 'n_words': 135}