Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- Fix: Resolve compile-time error about implicit declarations (#1646)
- Fix: fatal out of memory error extracting from a VOB PS
- Fix: Unit Test Rust failing due to changes in Rust Version 1.86.0
- Fix: Build with ENABLE_FFMPEG to support ffmpeg 5

0.94 (2021-12-14)
-----------------
Expand Down
9 changes: 4 additions & 5 deletions src/lib_ccx/ffmpeg_intgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ void *init_ffmpeg(const char *path)
int stream_index = 0;
struct ffmpeg_ctx *ctx;
AVCodec *dec = NULL;
avcodec_register_all();

if (ccx_options.debug_mask & CCX_DMT_VERBOSE)
av_log_set_level(AV_LOG_INFO);
Expand Down Expand Up @@ -105,7 +104,7 @@ void *init_ffmpeg(const char *path)
goto fail;
}
stream_index = ret;
ctx->dec_ctx = ctx->ifmt->streams[stream_index]->codec;
ctx->dec_ctx = ctx->ifmt->streams[stream_index]->codecpar;
ctx->stream_index = stream_index;
ret = avcodec_open2(ctx->dec_ctx, dec, NULL);
if (ret < 0)
Expand Down Expand Up @@ -149,7 +148,7 @@ int ff_get_ccframe(void *arg, unsigned char *data, int maxlen)
return AVERROR(EAGAIN);
}

avcodec_send_packet(ctx->codec_ctx, &ctx->packet);
avcodec_send_packet(ctx->dec_ctx, &packet);
ret = avcodec_receive_frame(ctx->dec_ctx, ctx->frame);
if (ret < 0)
{
Expand All @@ -159,15 +158,15 @@ int ff_get_ccframe(void *arg, unsigned char *data, int maxlen)
{
return AVERROR(EAGAIN);
}
// current_pts = av_frame_get_best_effort_timestamp(ctx->frame);
// current_pts = ctx->frame->best_effort_timestamp;
// if(!pts_set)
// pts_set = 1;
// set_fts();
for (int i = 0; i < ctx->frame->nb_side_data; i++)
{
if (ctx->frame->side_data[i]->type == AV_FRAME_DATA_A53_CC)
{
ctx->frame->pts = av_frame_get_best_effort_timestamp(ctx->frame);
ctx->frame->pts = ctx->frame->best_effort_timestamp;
if (ctx->frame->side_data[i]->size > maxlen)
av_log(NULL, AV_LOG_ERROR, "Please consider increasing length of data\n");
else
Expand Down
3 changes: 3 additions & 0 deletions src/lib_ccx/hardsubx_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include <leptonica/allheaders.h>
#include <tesseract/capi.h>
#include "hardsubx.h"
#ifdef ENABLE_FFMPEG
#include "ffmpeg_intgr.h"
#endif

#ifdef DISABLE_RUST
char *_process_frame_white_basic(struct lib_hardsubx_ctx *ctx, AVFrame *frame, int width, int height, int index)
Expand Down
Loading