author | Ke Gong <ke.gong@amlogic.com> | 2017-11-14 09:27:07 (GMT) |
---|---|---|
committer | Ke Gong <ke.gong@amlogic.com> | 2017-11-14 09:27:07 (GMT) |
commit | 5d9f85c4cb85d188b3ab994333131b4576ed6f1c (patch) | |
tree | aad7029e80bc94cd62951329302f8884e3a46fa3 | |
parent | 57ff963501b7315f0aab0065c534013b822ad110 (diff) | |
download | dvb-ref-o-20171115.zip dvb-ref-o-20171115.tar.gz dvb-ref-o-20171115.tar.bz2 |
PD#154479: am_av: fix AMSTREAM_IOC_VDECSTAT kernel ioctl error
Change-Id: Ic56a6182a4a4dcc8be3c8b44baf4a070ed0791ef
-rw-r--r-- | am_adp/am_av/aml/aml.c | 87 | ||||
-rwxr-xr-x | lib32/libam_ver.so | 6 | ||||
-rwxr-xr-x | lib64/libam_ver.so | 4 | ||||
-rwxr-xr-x | libam_ver.so | 4 |
4 files changed, 60 insertions, 41 deletions
diff --git a/am_adp/am_av/aml/aml.c b/am_adp/am_av/aml/aml.c index c883ecd..0b25ddb 100644 --- a/am_adp/am_av/aml/aml.c +++ b/am_adp/am_av/aml/aml.c @@ -3518,30 +3518,33 @@ static void* aml_av_monitor_thread(void *arg) } AM_TIME_GetClock(&now); - - if (ioctl(ts->fd, AMSTREAM_IOC_AB_STATUS, (unsigned long)&astatus) != -1) { - abuf_size = astatus.status.size; - abuf_level = astatus.status.data_len; - abuf_read_ptr = astatus.status.read_pointer; - } else { - //AM_DEBUG(1, "cannot get audio buffer status"); - abuf_size = 0; - abuf_level = 0; - abuf_read_ptr = 0; + if (has_audio) + { + if (ioctl(ts->fd, AMSTREAM_IOC_AB_STATUS, (unsigned long)&astatus) != -1) { + abuf_size = astatus.status.size; + abuf_level = astatus.status.data_len; + abuf_read_ptr = astatus.status.read_pointer; + } else { + //AM_DEBUG(1, "cannot get audio buffer status"); + abuf_size = 0; + abuf_level = 0; + abuf_read_ptr = 0; + } } - - if (ioctl(ts->fd, AMSTREAM_IOC_VB_STATUS, (unsigned long)&vstatus) != -1) { - vbuf_size = vstatus.status.size; - vbuf_level = vstatus.status.data_len; - vbuf_read_ptr = vstatus.status.read_pointer; - //is_hd_video = vstatus.vstatus.width > 720; - } else { - //AM_DEBUG(1, "cannot get video buffer status"); - vbuf_size = 0; - vbuf_level = 0; - vbuf_read_ptr = 0; + if (has_video) + { + if (ioctl(ts->fd, AMSTREAM_IOC_VB_STATUS, (unsigned long)&vstatus) != -1) { + vbuf_size = vstatus.status.size; + vbuf_level = vstatus.status.data_len; + vbuf_read_ptr = vstatus.status.read_pointer; + //is_hd_video = vstatus.vstatus.width > 720; + } else { + //AM_DEBUG(1, "cannot get video buffer status"); + vbuf_size = 0; + vbuf_level = 0; + vbuf_read_ptr = 0; + } } - if (vbuf_level == 0) { if(!vbuf_level_empty_time) vbuf_level_empty_time = now; @@ -3577,18 +3580,20 @@ static void* aml_av_monitor_thread(void *arg) vrp_stop_dur = 0; } last_vbuf_read_ptr = vbuf_read_ptr; - - memset(&vstatus, 0, sizeof(vstatus)); - if (ioctl(ts->fd, AMSTREAM_IOC_VDECSTAT, (unsigned long)&vstatus) != -1) { - is_hd_video = (vstatus.vstatus.width > 720)? 1 : 0; - vdec_status = vstatus.vstatus.status; - frame_width = vstatus.vstatus.width; - frame_height= vstatus.vstatus.height; - //AM_DEBUG(1, "vdec width %d height %d status 0x%08x", frame_width, frame_height, vdec_status); - } else { - vdec_status = 0; - frame_width = 0; - frame_height= 0; + if (has_video) + { + memset(&vstatus, 0, sizeof(vstatus)); + if (ioctl(ts->fd, AMSTREAM_IOC_VDECSTAT, (unsigned long)&vstatus) != -1) { + is_hd_video = (vstatus.vstatus.width > 720)? 1 : 0; + vdec_status = vstatus.vstatus.status; + frame_width = vstatus.vstatus.width; + frame_height= vstatus.vstatus.height; + //AM_DEBUG(1, "vdec width %d height %d status 0x%08x", frame_width, frame_height, vdec_status); + } else { + vdec_status = 0; + frame_width = 0; + frame_height= 0; + } } if (AM_FileRead(AVS_PLUS_DECT_FILE, buf, sizeof(buf)) >= 0) { sscanf(buf, "%d", &avs_fmt); @@ -4839,6 +4844,13 @@ static AM_ErrorCode_t aml_get_astatus(AM_AV_Device_t *dev, AM_AV_AudioStatus_t * char buf[32]; void *adec = NULL; + AM_Bool_t has_audio = VALID_AUDIO(dev->ts_player.play_para.apid, dev->ts_player.play_para.afmt); + + if (!has_audio) + { + AM_DEBUG(1,"there is no audio pid data ,pls check your parameters"); + return AM_FAILURE; + } pthread_mutex_lock(&gAVMonLock); @@ -4999,6 +5011,13 @@ static AM_ErrorCode_t aml_get_vstatus(AM_AV_Device_t *dev, AM_AV_VideoStatus_t * struct am_io_param vstatus; char buf[32]; int fd, rc; + AM_Bool_t has_video = VALID_VIDEO(dev->ts_player.play_para.vpid, dev->ts_player.play_para.vfmt); + + if (!has_video) + { + // AM_DEBUG(1, "has no video pid data pls check your parameters"); + return AM_FAILURE; + } pthread_mutex_lock(&gAVMonLock); fd = get_amstream(dev); diff --git a/lib32/libam_ver.so b/lib32/libam_ver.so index dcc3baf..32d367c 100755 --- a/lib32/libam_ver.so +++ b/lib32/libam_ver.so @@ -1,4 +1,4 @@ -ELF +ELF 0å3ÿ/áÐKâ @@ -92,8 +92,8 @@ B¿&¼ñ óÿ°°¬€:óÿ°°°€8óÿ°°¨€Nóÿ°„€Xóÿ°°°€xóÿ°„€üóÿ°°ª€€ôÿ°°°€˜ôÿ°„€4õÿ°« -€˜ùÿ°°¬€Ôùÿ°°°€þÿ +€˜ùÿ°°¬€Ôùÿ°°°€þÿ A -"&Dlibam_ver.so +"&Dlibam_ver.so diff --git a/lib64/libam_ver.so b/lib64/libam_ver.so index be2d746..1105f75 100755 --- a/lib64/libam_ver.so +++ b/lib64/libam_ver.so @@ -1,2 +1,2 @@ -ELF - +ELF + diff --git a/libam_ver.so b/libam_ver.so index fb8363f..0377ba0 100755 --- a/libam_ver.so +++ b/libam_ver.so @@ -1,6 +1,6 @@ ELF -0å3ÿ/áÐKâ +0å3ÿ/áÐKâ A -"Dlibam_ver.so +"Dlibam_ver.so |