From 926a7f6a1721eb3d06d3007c1ebf2f58c0f9b961 Mon Sep 17 00:00:00 2001 From: Xinzheng Zhang Date: Tue, 20 Dec 2016 19:39:43 +0800 Subject: [PATCH] ff_ffplay: add a option for subtitle --- ijkmedia/ijkplayer/ff_ffplay.c | 2 ++ ijkmedia/ijkplayer/ff_ffplay_def.h | 1 + ijkmedia/ijkplayer/ff_ffplay_options.h | 2 ++ 3 files changed, 5 insertions(+) diff --git a/ijkmedia/ijkplayer/ff_ffplay.c b/ijkmedia/ijkplayer/ff_ffplay.c index da81cf79..772ed649 100755 --- a/ijkmedia/ijkplayer/ff_ffplay.c +++ b/ijkmedia/ijkplayer/ff_ffplay.c @@ -2445,6 +2445,8 @@ static int stream_component_open(FFPlayer *ffp, int stream_index) break; case AVMEDIA_TYPE_SUBTITLE: + if (!ffp->subtitle) break; + is->subtitle_stream = stream_index; is->subtitle_st = ic->streams[stream_index]; diff --git a/ijkmedia/ijkplayer/ff_ffplay_def.h b/ijkmedia/ijkplayer/ff_ffplay_def.h index a09829d9..5955cf21 100755 --- a/ijkmedia/ijkplayer/ff_ffplay_def.h +++ b/ijkmedia/ijkplayer/ff_ffplay_def.h @@ -550,6 +550,7 @@ typedef struct FFPlayer { int loop; int framedrop; int64_t seek_at_start; + int subtitle; int infinite_buffer; enum ShowMode show_mode; char *audio_codec_name; diff --git a/ijkmedia/ijkplayer/ff_ffplay_options.h b/ijkmedia/ijkplayer/ff_ffplay_options.h index 32ce0d74..270069ee 100644 --- a/ijkmedia/ijkplayer/ff_ffplay_options.h +++ b/ijkmedia/ijkplayer/ff_ffplay_options.h @@ -79,6 +79,8 @@ static const AVOption ffp_context_options[] = { OPTION_OFFSET(framedrop), OPTION_INT(0, -1, 120) }, { "seek-at-start", "set offset of player should be seeked", OPTION_OFFSET(seek_at_start), OPTION_INT64(0, 0, INT_MAX) }, + { "subtitle", "decode subtitle stream", + OPTION_OFFSET(subtitle), OPTION_INT(0, 0, 1) }, // FFP_MERGE: window_title #if CONFIG_AVFILTER { "af", "audio filters", -- GitLab