| 1976 | } |
| 1977 | |
| 1978 | static int open_demux_for_component(AVFormatContext *s, struct representation *pls) |
| 1979 | { |
| 1980 | int ret = 0; |
| 1981 | int i; |
| 1982 | |
| 1983 | pls->parent = s; |
| 1984 | pls->cur_seq_no = calc_cur_seg_no(s, pls); |
| 1985 | |
| 1986 | if (!pls->last_seq_no) |
| 1987 | pls->last_seq_no = calc_max_seg_no(pls, s->priv_data); |
| 1988 | |
| 1989 | ret = reopen_demux_for_component(s, pls); |
| 1990 | if (ret < 0) |
| 1991 | return ret; |
| 1992 | |
| 1993 | for (i = 0; i < pls->ctx->nb_streams; i++) { |
| 1994 | AVStream *st = avformat_new_stream(s, NULL); |
| 1995 | AVStream *ist = pls->ctx->streams[i]; |
| 1996 | if (!st) |
| 1997 | return AVERROR(ENOMEM); |
| 1998 | |
| 1999 | st->id = i; |
| 2000 | |
| 2001 | ret = avcodec_parameters_copy(st->codecpar, ist->codecpar); |
| 2002 | if (ret < 0) |
| 2003 | return ret; |
| 2004 | |
| 2005 | avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den); |
| 2006 | |
| 2007 | // copy disposition |
| 2008 | st->disposition = ist->disposition; |
| 2009 | } |
| 2010 | |
| 2011 | return 0; |
| 2012 | } |
| 2013 | |
| 2014 | static int is_common_init_section_exist(struct representation **pls, int n_pls) |
| 2015 | { |
no test coverage detected