[FFmpeg-devel] [PATCH 1/3] avformat/subtitles: make dropping duplicate events optional
Clément Bœsch
u at pkh.me
Sun Sep 20 22:57:38 CEST 2015
On Sun, Sep 20, 2015 at 04:12:36PM +0200, wm4 wrote:
> ---
> libavformat/subtitles.c | 3 ++-
> libavformat/subtitles.h | 1 +
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c
> index 192043f..bb89766 100644
> --- a/libavformat/subtitles.c
> +++ b/libavformat/subtitles.c
> @@ -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)
> 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)
> diff --git a/libavformat/subtitles.h b/libavformat/subtitles.h
> index c70f6ff..85f8864 100644
> --- a/libavformat/subtitles.h
> +++ b/libavformat/subtitles.h
> @@ -105,6 +105,7 @@ typedef struct {
> int allocated_size; ///< allocated size for subs
> int current_sub_idx; ///< current position for the read packet callback
> enum sub_sort sort; ///< sort method to use when finalizing subtitles
> + int keep_duplicates; ///< set to 1 to keep duplicate subtitle events
duplicated
> } FFDemuxSubtitlesQueue;
>
OK otherwise
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150920/b328e0c3/attachment.sig>
More information about the ffmpeg-devel
mailing list