Skip to content

Commit

Permalink
Use strlist_contains() to find a muxer
Browse files Browse the repository at this point in the history
The AVOutputFormat name is a string list: it contains names separated by
',' (possibly only one).
  • Loading branch information
rom1v committed Apr 25, 2021
1 parent ffc0021 commit 151bc16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/recorder.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <libavutil/time.h>

#include "util/log.h"
#include "util/str_util.h"

/** Downcast packet_sink to recorder */
#define DOWNCAST(SINK) container_of(SINK, struct recorder, packet_sink)
Expand All @@ -22,8 +23,8 @@ find_muxer(const char *name) {
#else
oformat = av_oformat_next(oformat);
#endif
// until null or with having the requested name
} while (oformat && strcmp(oformat->name, name));
// until null or containing the requested name
} while (oformat && !strlist_contains(oformat->name, ',', name));
return oformat;
}

Expand Down

0 comments on commit 151bc16

Please sign in to comment.