Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib_ccx/ccx_demuxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ static int ccx_demuxer_open(struct ccx_demuxer *ctx, const char *file)
return -1;
}

struct lib_ccx_ctx *parent_ctx = (struct lib_ccx_ctx *)ctx->parent;
int saved_current_file = parent_ctx ? parent_ctx->current_file : -1;
if (ctx->auto_stream == CCX_SM_AUTODETECT)
{
detect_stream_type(ctx);
if (parent_ctx)
parent_ctx->current_file = saved_current_file;
switch (ctx->stream_mode)
{
case CCX_SM_ELEMENTARY_OR_NOT_FOUND:
Expand Down
1 change: 1 addition & 0 deletions src/lib_ccx/matroska.c
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,7 @@ void matroska_parse(struct matroska_ctx *mkv_ctx)

FILE *create_file(struct lib_ccx_ctx *ctx)
{

char *filename = ctx->inputfile[ctx->current_file];
FILE *file = fopen(filename, "rb");
return file;
Expand Down
4 changes: 4 additions & 0 deletions src/rust/src/demuxer/demux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,12 @@ impl CcxDemuxer<'_> {
}
}
// Stream mode detection
let saved_current_file = self.parent.as_ref().map(|p| p.current_file);
if self.auto_stream == StreamMode::Autodetect {
detect_stream_type(self, ccx_options);
if let (Some(parent), Some(saved)) = (self.parent.as_mut(), saved_current_file) {
parent.current_file = saved;
}
match self.stream_mode {
StreamMode::ElementaryOrNotFound => {
info!("\rFile seems to be an elementary stream")
Expand Down
Loading