On Fri, 19 Sep 2014 07:33:26 -0700
Nicholas Robbins <[email protected]> wrote:
> Ok, not to beat a dead horse, but I think I've gotten this working. I think
> it might work better in lavc/dvdsubdec.c. AFAICT this works and doesn't
> produce mangled tracks. Patch at end of email. (Sorry for the inline patch)
> If this is a good patch, I'll add the appropriate documentation and do a
> proper commit-patch
>
>
>
> diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
> index 7355c03..874c28b 100644
> --- a/libavcodec/dvdsubdec.c
> +++ b/libavcodec/dvdsubdec.c
> @@ -39,6 +39,7 @@ typedef struct DVDSubContext
> uint8_t alpha[256];
> uint8_t *buf;
> int buf_size;
> + int only_dec_forced;
> #ifdef DEBUG
> int sub_id;
> #endif
> @@ -548,6 +549,9 @@ static int dvdsub_decode(AVCodecContext *avctx,
> if (!is_menu && find_smallest_bounding_rectangle(sub) == 0)
> goto no_subtitle;
>
> + if (ctx->only_dec_forced && !(sub->rects[0]->flags &
> AV_SUBTITLE_FLAG_FORCED))
> + goto no_subtitle;
> +
> #if defined(DEBUG)
> {
> char ppm_name[32];
> @@ -652,6 +656,7 @@ static av_cold int dvdsub_close(AVCodecContext *avctx)
> #define VD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
> static const AVOption options[] = {
> { "palette", "set the global palette", OFFSET(palette_str),
> AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VD },
> + { "only_dec_forced", "Only decode forced subtitles",
> OFFSET(only_dec_forced), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, VD},
> { NULL }
> };
> static const AVClass dvdsub_class = {
Sorry, but didn't the discussion go towards that ffmpeg.c should filter
out subtitles flagged as forced?
And in fact, the PGS decoder should be changed to flag forced subs
correctly.
_______________________________________________
ffmpeg-devel mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel