Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync release/5.1 with MythTV #11

Open
wants to merge 9 commits into
base: release/5.1
Choose a base branch
from
2 changes: 1 addition & 1 deletion compat/w32dlfcn.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static inline wchar_t *get_module_filename(HMODULE module)

do {
path_size = path_size ? FFMIN(2 * path_size, INT16_MAX + 1) : MAX_PATH;
new_path = av_realloc_array(path, path_size, sizeof *path);
new_path = (wchar_t *)av_realloc_array(path, path_size, sizeof *path);
if (!new_path) {
av_free(path);
return NULL;
Expand Down
5 changes: 3 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5571,7 +5571,8 @@ case $target_os in
SLIBPREF="libmyth"
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
#SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
if test_cmd lib.exe -list; then
SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
if enabled x86_64; then
Expand All @@ -5582,7 +5583,7 @@ case $target_os in
fi
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS=
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
#SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
Expand Down
11 changes: 6 additions & 5 deletions ffbuild/library.mak
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ INCINSTDIR := $(INCDIR)/lib$(NAME)

INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)

all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME) $(SUBDIR)lib$(FULLNAME).pc
all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME) $(SUBDIR)lib$(FULLNAME).pc
all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME) $(SUBDIR)libmyth$(FULLNAME).pc
all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME) $(SUBDIR)libmyth$(FULLNAME).pc

LIBOBJS := $(OBJS) $(SHLIBOBJS) $(STLIBOBJS) $(SUBDIR)%.h.o $(TESTOBJS)
$(LIBOBJS) $(LIBOBJS:.o=.s) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H
Expand Down Expand Up @@ -40,6 +40,7 @@ $(SUBDIR)$(LIBNAME): $(OBJS) $(STLIBOBJS)

#install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
install-headers: install-lib$(NAME)-headers
install-pkgconfig: install-libmyth$(NAME)-pkgconfig

install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
Expand All @@ -56,7 +57,7 @@ $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
$(SUBDIR)lib$(NAME).version: $(SUBDIR)version.h $(SUBDIR)version_major.h | $(SUBDIR)
$$(M) $$(SRC_PATH)/ffbuild/libversion.sh $(NAME) $$^ > $$@

$(SUBDIR)lib$(FULLNAME).pc: $(SUBDIR)version.h ffbuild/config.sh | $(SUBDIR)
$(SUBDIR)libmyth$(FULLNAME).pc: $(SUBDIR)version.h ffbuild/config.sh | $(SUBDIR)
$$(M) $$(SRC_PATH)/ffbuild/pkgconfig_generate.sh $(NAME) "$(DESC)"

$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
Expand Down Expand Up @@ -96,7 +97,7 @@ install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
$(Q)mkdir -p "$(INCINSTDIR)"
$$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"

install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(FULLNAME).pc
install-libmyth$(NAME)-pkgconfig: $(SUBDIR)libmyth$(FULLNAME).pc
$(Q)mkdir -p "$(PKGCONFIGDIR)"
$$(INSTALL) -m 644 $$^ "$(PKGCONFIGDIR)"

Expand All @@ -113,7 +114,7 @@ uninstall-headers::
-rmdir "$(INCINSTDIR)"

uninstall-pkgconfig::
$(RM) "$(PKGCONFIGDIR)/lib$(FULLNAME).pc"
$(RM) "$(PKGCONFIGDIR)/libmyth$(FULLNAME).pc"
endef

$(eval $(RULES))
Expand Down
4 changes: 2 additions & 2 deletions ffbuild/pkgconfig_generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ fi

shortname=$1
name=lib${shortname}
fullname=${name}${build_suffix}
fullname=libmyth${shortname}${build_suffix}
comment=$2
libs=$(eval echo \$extralibs_${shortname})
deps=$(eval echo \$${shortname}_deps)

for dep in $deps; do
depname=lib${dep}
fulldepname=${depname}${build_suffix}
fulldepname=libmyth${dep}${build_suffix}
. ${depname}/${depname}.version
depversion=$(eval echo \$${depname}_VERSION)
requires="$requires ${fulldepname} >= ${depversion}, "
Expand Down
15 changes: 6 additions & 9 deletions fftools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,14 @@ fftools/ffprobe.o fftools/cmdutils.o: libavutil/ffversion.h | fftools
OUTDIRS += fftools

# ${MYTHPROGS}:
mythffmpeg:
cp ffmpeg_g mythffmpeg
mythffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
cp ffmpeg_g$(EXESUF) mythffmpeg$(EXESUF)

mythffprobe:
cp ffprobe_g mythffprobe
mythffprobe$(EXESUF): ffprobe_g$(EXESUF)
cp ffprobe_g$(EXESUF) mythffprobe$(EXESUF)

mythffserver:
cp ffserver_g mythffserver

mythffplay:
cp ffplay_g mythffplay
mythffplay$(EXESUF): ffplay_g$(EXESUF)
cp ffplay_g$(EXESUF) mythffplay$(EXESUF)

ifdef AVPROGS
install: install-mythprogs
Expand Down
26 changes: 23 additions & 3 deletions libavcodec/x86/mathops.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@
static av_always_inline av_const int MULL(int a, int b, unsigned shift)
{
int rt, dummy;
if (__builtin_constant_p(shift))
__asm__ (
"imull %3 \n\t"
"shrdl %4, %%edx, %%eax \n\t"
:"=a"(rt), "=d"(dummy)
:"a"(a), "rm"(b), "ci"((uint8_t)shift)
:"a"(a), "rm"(b), "i"(shift & 0x1F)
);
else
__asm__ (
"imull %3 \n\t"
"shrdl %4, %%edx, %%eax \n\t"
:"=a"(rt), "=d"(dummy)
:"a"(a), "rm"(b), "c"((uint8_t)shift)
);
return rt;
}

Expand Down Expand Up @@ -113,19 +121,31 @@ __asm__ volatile(\
// avoid +32 for shift optimization (gcc should do that ...)
#define NEG_SSR32 NEG_SSR32
static inline int32_t NEG_SSR32( int32_t a, int8_t s){
if (__builtin_constant_p(s))
__asm__ ("sarl %1, %0\n\t"
: "+r" (a)
: "ic" ((uint8_t)(-s))
: "i" (-s & 0x1F)
);
else
__asm__ ("sarl %1, %0\n\t"
: "+r" (a)
: "c" ((uint8_t)(-s))
);
return a;
}

#define NEG_USR32 NEG_USR32
static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
if (__builtin_constant_p(s))
__asm__ ("shrl %1, %0\n\t"
: "+r" (a)
: "ic" ((uint8_t)(-s))
: "i" (-s & 0x1F)
);
else
__asm__ ("shrl %1, %0\n\t"
: "+r" (a)
: "c" ((uint8_t)(-s))
);
return a;
}

Expand Down
3 changes: 0 additions & 3 deletions libavformat/libavformat.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ LIBAVFORMAT_MAJOR {
global:
av*;
ffurl_read;
ffurl_read_complete;
ffurl_seek;
ffurl_size;
ffurl_protocol_next;
ffurl_open;
ffurl_open_whitelist;
ffurl_close;
ffurl_write;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/mpegts-mythtv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2981,7 +2981,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
* create new ones, and notify any listener.
*/
equal_streams = pmt_equal_streams(ts, items, last_item);
if (0 && (equal_streams != last_item || ts->pid_cnt != last_item))
if (equal_streams != last_item || ts->pid_cnt != last_item)
{
AVFormatContext *avctx = ts->stream;

Expand Down