Commit c216324a authored by wm4's avatar wm4

avformat/subtitles: make dropping duplicate events optional

parent a47ad06b
...@@ -204,7 +204,8 @@ void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q) ...@@ -204,7 +204,8 @@ void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q)
if (q->subs[i].duration == -1 && i < q->nb_subs - 1) if (q->subs[i].duration == -1 && i < q->nb_subs - 1)
q->subs[i].duration = q->subs[i + 1].pts - q->subs[i].pts; q->subs[i].duration = q->subs[i + 1].pts - q->subs[i].pts;
drop_dups(log_ctx, q); if (!q->keep_duplicates)
drop_dups(log_ctx, q);
} }
int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt) int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
......
...@@ -105,6 +105,7 @@ typedef struct { ...@@ -105,6 +105,7 @@ typedef struct {
int allocated_size; ///< allocated size for subs int allocated_size; ///< allocated size for subs
int current_sub_idx; ///< current position for the read packet callback int current_sub_idx; ///< current position for the read packet callback
enum sub_sort sort; ///< sort method to use when finalizing subtitles enum sub_sort sort; ///< sort method to use when finalizing subtitles
int keep_duplicates; ///< set to 1 to keep duplicated subtitle events
} FFDemuxSubtitlesQueue; } FFDemuxSubtitlesQueue;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment