(7 << ES_SUB_WR_ENDIAN_BIT) | ES_SUB_MAN_RD_PTR);
/* #if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON8 */
- if (has_hevc_vdec())
- r = pts_start((is_hevc) ? PTS_TYPE_HEVC : PTS_TYPE_VIDEO);
- else
- /* #endif */
- r = pts_start(PTS_TYPE_VIDEO);
-
- if (r < 0) {
- pr_info("Video pts start failed.(%d)\n", r);
- goto err1;
+ if (vid != 0xffff) {
+ if (has_hevc_vdec())
+ r = pts_start((is_hevc) ? PTS_TYPE_HEVC : PTS_TYPE_VIDEO);
+ else
+ /* #endif */
+ r = pts_start(PTS_TYPE_VIDEO);
+ if ((r < 0) && (r != -EBUSY)) {
+ pr_info("Video pts start failed.(%d)\n", r);
+ goto err1;
+ }
}
- r = pts_start(PTS_TYPE_AUDIO);
- if (r < 0) {
- pr_info("Audio pts start failed.(%d)\n", r);
- goto err2;
+
+ if (aid != 0xffff) {
+ r = pts_start(PTS_TYPE_AUDIO);
+ if ((r < 0) && (r != -EBUSY)) {
+ pr_info("Audio pts start failed.(%d)\n", r);
+ goto err2;
+ }
}
/*TODO irq */
struct stream_buf_s *abuf,
const char __user *buf, size_t count)
{
+ struct port_priv_s *priv = (struct port_priv_s *)file->private_data;
+ struct stream_port_s *port = priv->port;
int write_size;
+ if (!((port->flag & PORT_FLAG_VID) &&
+ (port->flag & PORT_FLAG_AID))) {
+ struct stream_buf_s *buf =
+ (port->flag & PORT_FLAG_VID) ? vbuf : abuf;
+
+ return min_t(int, count, stbuf_space(buf));
+ }
+
if (vbuf->max_buffer_delay_ms > 0 && abuf->max_buffer_delay_ms > 0 &&
stbuf_level(vbuf) > 1024 && stbuf_level(abuf) > 256) {
int vdelay =
}
}
- write_size = min(stbuf_space(vbuf), stbuf_space(abuf));
- write_size = min(count, write_size);
+ if ((port->flag & PORT_FLAG_VID) &&
+ (port->flag & PORT_FLAG_AID)) {
+ write_size = min(stbuf_space(vbuf), stbuf_space(abuf));
+ write_size = min(count, write_size);
+ } else {
+ struct stream_buf_s *buf =
+ (port->flag & PORT_FLAG_VID) ? vbuf : abuf;
+
+ write_size = min_t(int, count, stbuf_space(buf));
+ }
/* pr_info("write_size = %d,count = %d,\n",*/
/*write_size, count); */
if (write_size > 0)