From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg_demux: set stream index right before sending packet to scheduler
Date: Mon, 5 Feb 2024 18:09:59 +0100
Message-ID: <20240205170959.11000-1-anton@khirnov.net> (raw)
This avoids assuming that it survives unchanged through bitstream
filters, if present.
---
fftools/ffmpeg_demux.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 60dc9620c2..3bf95e2c3f 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -475,8 +475,6 @@ static int input_packet_process(Demuxer *d, AVPacket *pkt, unsigned *send_flags)
av_ts2str(f->ts_offset), av_ts2timestr(f->ts_offset, &AV_TIME_BASE_Q));
}
- pkt->stream_index = ds->sch_idx_stream;
-
return 0;
}
@@ -505,6 +503,8 @@ static int do_send(Demuxer *d, DemuxStream *ds, AVPacket *pkt, unsigned flags,
{
int ret;
+ pkt->stream_index = ds->sch_idx_stream;
+
ret = sch_demux_send(d->sch, d->f.index, pkt, flags);
if (ret == AVERROR_EOF) {
av_packet_unref(pkt);
@@ -546,7 +546,6 @@ static int demux_send(Demuxer *d, DemuxThreadContext *dt, DemuxStream *ds,
d->pkt_heartbeat->pts = pkt->pts;
d->pkt_heartbeat->time_base = pkt->time_base;
- d->pkt_heartbeat->stream_index = ds1->sch_idx_stream;
d->pkt_heartbeat->opaque = (void*)(intptr_t)PKT_OPAQUE_SUB_HEARTBEAT;
ret = do_send(d, ds1, d->pkt_heartbeat, 0, "heartbeat");
--
2.42.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
reply other threads:[~2024-02-05 17:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240205170959.11000-1-anton@khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git