# Deal with common $arch aliases
case "$arch" in
- arm*)
+ aarch64|arm64)
+ arch="aarch64"
+ ;;
+ arm*|iPad*)
arch="arm"
;;
mips*|IP*)
emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
enable dos_paths
+ enable_weak os2threads
;;
gnu/kfreebsd)
- add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
+ add_cppflags -D_BSD_SOURCE
;;
gnu)
- add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
;;
qnx)
add_cppflags -D_QNX_SOURCE
"defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \
(__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
die "ERROR: MinGW runtime version must be >= 3.15."
+ if check_cpp_condition _mingw.h "defined(__MINGW64_VERSION_MAJOR) && \
+ __MINGW64_VERSION_MAJOR < 3"; then
+ add_compat msvcrt/snprintf.o
+ add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
+ fi
elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
libc_type=newlib
+ add_cppflags -U__STRICT_ANSI__
elif check_func_headers stdlib.h _get_doserrno; then
libc_type=msvcrt
add_compat strtod.o strtod=avpriv_strtod
DISPLAY_SEGMENT = 0x80,
};
-typedef struct PGSSubPresentation {
+typedef struct PGSSubPictureReference {
int x;
int y;
- int id_number;
- int object_number;
- uint8_t composition_flag;
+ int picture_id;
+ int composition;
+} PGSSubPictureReference;
+
+typedef struct PGSSubPresentation {
+ int id_number;
+ int object_count;
+ PGSSubPictureReference *objects;
+ int64_t pts;
} PGSSubPresentation;
typedef struct PGSSubPicture {
} PGSSubPicture;
typedef struct PGSSubContext {
+ AVClass *class;
PGSSubPresentation presentation;
uint32_t clut[256];
- PGSSubPicture picture;
+ PGSSubPicture pictures[UINT16_MAX];
- int64_t pts;
+ int forced_subs_only;
} PGSSubContext;
static av_cold int init_decoder(AVCodecContext *avctx)
* @param buf pointer to the packet to process
* @param buf_size size of packet to process
* @todo TODO: Implement cropping
- * @todo TODO: Implement forcing of subtitles
*/
static void parse_presentation_segment(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+ const uint8_t *buf, int buf_size,
+ int64_t pts)
{
PGSSubContext *ctx = avctx->priv_data;
int w = bytestream_get_be16(&buf);
int h = bytestream_get_be16(&buf);
+ uint16_t object_index;
+
+ ctx->presentation.pts = pts;
+
av_dlog(avctx, "Video Dimensions %dx%d\n",
w, h);
if (av_image_check_size(w, h, 0, avctx) >= 0)
* not been cleared by a subsequent empty display command.
*/
- pts = ctx->pts != AV_NOPTS_VALUE ? ctx->pts : sub->pts;
++ pts = ctx->presentation.pts != AV_NOPTS_VALUE ? ctx->presentation.pts : sub->pts;
memset(sub, 0, sizeof(*sub));
- sub->pts = ctx->presentation.pts;
+ sub->pts = pts;
- ctx->pts = AV_NOPTS_VALUE;
++ ctx->presentation.pts = AV_NOPTS_VALUE;
- // Blank if last object_number was 0.
- // Note that this may be wrong for more complex subtitles.
- if (!ctx->presentation.object_number)
+ // Blank if last object_count was 0.
+ if (!ctx->presentation.object_count)
return 1;
+
sub->start_display_time = 0;
sub->end_display_time = 20000;
sub->format = 0;
parse_picture_segment(avctx, buf, segment_length);
break;
case PRESENTATION_SEGMENT:
- parse_presentation_segment(avctx, buf, segment_length);
- ctx->pts = sub->pts;
- parse_presentation_segment(avctx, buf, segment_length, avpkt->pts);
++ parse_presentation_segment(avctx, buf, segment_length, sub->pts);
break;
case WINDOW_SEGMENT:
/*