summaryrefslogtreecommitdiff
authorChengshun Wang <chengshun.wang@amlogic.com>2016-12-09 12:09:00 (GMT)
committer Chengshun Wang <chengshun.wang@amlogic.com>2016-12-09 12:13:10 (GMT)
commitf817e39b2f395de31af02ec9072d16ca242febbc (patch)
tree3ac228f44434395584226f207867f38110cc5c47
parente5265c27633f491fa92778a0911558e7c733643e (diff)
downloadSubTitle-f817e39b2f395de31af02ec9072d16ca242febbc.zip
SubTitle-f817e39b2f395de31af02ec9072d16ca242febbc.tar.gz
SubTitle-f817e39b2f395de31af02ec9072d16ca242febbc.tar.bz2
PD#133048: fix subtitle cannot show in android 7.0
Change-Id: Ie26c55e1eac7ec4275cb5992cf1b676278b8cdf1
Diffstat
-rw-r--r--jni/subtitle/amstream.h2
-rw-r--r--jni/subtitle/sub_control.c5
-rw-r--r--jni/subtitle/sub_jni.c12
3 files changed, 10 insertions, 9 deletions
diff --git a/jni/subtitle/amstream.h b/jni/subtitle/amstream.h
index 0cddcc5..0093204 100644
--- a/jni/subtitle/amstream.h
+++ b/jni/subtitle/amstream.h
@@ -67,7 +67,7 @@
#define AMSTREAM_IOC_AVTHRESH _IOW(AMSTREAM_IOC_MAGIC, 0x18, int)
#define AMSTREAM_IOC_SYNCTHRESH _IOW(AMSTREAM_IOC_MAGIC, 0x19, int)
#define AMSTREAM_IOC_SUB_RESET _IOW(AMSTREAM_IOC_MAGIC, 0x1a, int)
-#define AMSTREAM_IOC_SUB_LENGTH _IOR(AMSTREAM_IOC_MAGIC, 0x1b, unsigned long)
+#define AMSTREAM_IOC_SUB_LENGTH _IOR(AMSTREAM_IOC_MAGIC, 0x1b, int)
#define AMSTREAM_IOC_SET_DEC_RESET _IOW(AMSTREAM_IOC_MAGIC, 0x1c, int)
#define AMSTREAM_IOC_TS_SKIPBYTE _IOW(AMSTREAM_IOC_MAGIC, 0x1d, int)
#define AMSTREAM_IOC_SUB_TYPE _IOW(AMSTREAM_IOC_MAGIC, 0x1e, int)
diff --git a/jni/subtitle/sub_control.c b/jni/subtitle/sub_control.c
index 2ff9da7..1b24c37 100644
--- a/jni/subtitle/sub_control.c
+++ b/jni/subtitle/sub_control.c
@@ -28,8 +28,9 @@ int subtitle_poll_sub_fd(int sub_fd, int timeout)
int subtitle_get_sub_size_fd(int sub_fd)
{
- int sub_size, r;
- r = ioctl(sub_fd, AMSTREAM_IOC_SUB_LENGTH, (unsigned long)&sub_size);
+ unsigned long sub_size;
+ int r;
+ r = ioctl(sub_fd, AMSTREAM_IOC_SUB_LENGTH, &sub_size);
if (r < 0)
return 0;
else
diff --git a/jni/subtitle/sub_jni.c b/jni/subtitle/sub_jni.c
index 8bf596b..106a7df 100644
--- a/jni/subtitle/sub_jni.c
+++ b/jni/subtitle/sub_jni.c
@@ -303,7 +303,7 @@ JNIEXPORT jobject JNICALL getrawdata(JNIEnv *env, jclass cl, jint msec)
(jbyte *)get_inter_spu_data());
LOGE("getrawdata: SetByteArrayRegion finish");
jobject obj = (*env)->NewObject(env, cls, constrforstr, array,
- get_inter_spu_delay() / 90, 0);
+ get_inter_spu_delay() / 90, NULL);
LOGE("getrawdata: NewObject finish");
add_read_position();
if (!obj)
@@ -329,7 +329,7 @@ JNIEXPORT jobject JNICALL getrawdata(JNIEnv *env, jclass cl, jint msec)
(get_inter_spu_pts() - get_subtitle_startpts()) / 90;
jobject obj =
(*env)->NewObject(env, cls, constrfortt, array, 0, sub_size,
- sub_start_pts, 0, 0);
+ sub_start_pts, 0, NULL);
LOGE("getrawdata: NewObject finish");
add_read_position();
if (!obj)
@@ -363,7 +363,7 @@ JNIEXPORT jobject JNICALL getrawdata(JNIEnv *env, jclass cl, jint msec)
(*env)->NewObject(env, cls, constrforpgs, array, 1,
get_inter_spu_width(),
get_inter_spu_height(), 0, 0, sub_size,
- sub_start_pts, delay_pts, 0);
+ sub_start_pts, delay_pts, NULL);
LOGE("getrawdata: NewObject finish");
free_last_inter_spu_data();
add_read_position();
@@ -396,7 +396,7 @@ JNIEXPORT jobject JNICALL getrawdata(JNIEnv *env, jclass cl, jint msec)
(*env)->NewObject(env, cls, constrforpgs, array, 1,
get_inter_spu_width(),
get_inter_spu_height(), get_inter_spu_origin_width(), get_inter_spu_origin_height(), sub_size,
- start_time, delay_time, 0);
+ start_time, delay_time, NULL);
free_last_inter_spu_data();
add_read_position();
if (!obj)
@@ -451,7 +451,7 @@ JNIEXPORT jobject JNICALL getrawdata(JNIEnv *env, jclass cl, jint msec)
get_inter_spu_height(),
(get_inter_spu_delay() -
get_subtitle_startpts()) / 90,
- 0);
+ NULL);
add_read_position();
if (!obj)
{
@@ -536,7 +536,7 @@ JNIEXPORT jobject JNICALL getidxsubrawdata(JNIEnv *env, jclass cl, jint msec)
jobject obj = (*env)->NewObject(env, cls, constr, array, 1,
vobsub->vob_subtitle_config.width,
vobsub->vob_subtitle_config.height,
- vobsub->cur_endpts100 / 90, 0);
+ vobsub->cur_endpts100 / 90, NULL);
if (!obj)
{
LOGE("parseSubtitleFile: failed to create an object");