This avoids assuming that it survives unchanged through bitstream filters, if present.
Unified · Split
| @@ -475,8 +475,6 @@ static int input_packet_process(Demuxer *d, AVPacket *pkt, unsigned *send_flags) · 474 unmodified lines | ||
| 475 | 475 | av_ts2str(f->ts_offset), av_ts2timestr(f->ts_offset, &AV_TIME_BASE_Q)); |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | − pkt->stream_index = ds->sch_idx_stream; | |
| 479 | − | |
| 480 | 478 | return 0; |
| 481 | 479 | } |
| 482 | 480 | |
| @@ -505,6 +503,8 @@ static int do_send(Demuxer *d, DemuxStream *ds, AVPacket *pkt, unsigned flags, · 22 unmodified lines | ||
| 505 | 503 | { |
| 506 | 504 | int ret; |
| 507 | 505 | |
| 506 | + pkt->stream_index = ds->sch_idx_stream; | |
| 507 | + | |
| 508 | 508 | ret = sch_demux_send(d->sch, d->f.index, pkt, flags); |
| 509 | 509 | if (ret == AVERROR_EOF) { |
| 510 | 510 | av_packet_unref(pkt); |
| @@ -546,7 +546,6 @@ static int demux_send(Demuxer *d, DemuxThreadContext *dt, DemuxStream *ds, · 35 unmodified lines | ||
| 546 | 546 | |
| 547 | 547 | d->pkt_heartbeat->pts = pkt->pts; |
| 548 | 548 | d->pkt_heartbeat->time_base = pkt->time_base; |
| 549 | − d->pkt_heartbeat->stream_index = ds1->sch_idx_stream; | |
| 550 | 549 | d->pkt_heartbeat->opaque = (void*)(intptr_t)PKT_OPAQUE_SUB_HEARTBEAT; |
| 551 | 550 | |
| 552 | 551 | ret = do_send(d, ds1, d->pkt_heartbeat, 0, "heartbeat"); |