On Sun, 29 Jan 2017, Peter Große wrote:
Also makes sure all streams are assigned to exactly one AdaptationSet.
This patch is originally based partially on code by Vignesh Venkatasubramanian.
Signed-off-by: Peter Große <[email protected]>
---
v2:
* changing default stream assignment moved to separate patch
* removed metadata field from AdaptationSet
* check strtol result in parse_adaptation_set to detect non-numeric input
* move allocation of adaptation set to separate function
* fix string parsing problems pointed out by Martin
---
libavformat/dashenc.c | 201 ++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 170 insertions(+), 31 deletions(-)
Very nice improvement from the previous iteration! I appreciate the fact
that the default behaviour isn't changed here as well.
+ os = &c->streams[i];
+ if (as->media_type == AVMEDIA_TYPE_UNKNOWN) {
+ as->media_type = s->streams[i]->codecpar->codec_type;
+ } else if (as->media_type != s->streams[i]->codecpar->codec_type) {
+ av_log(s, AV_LOG_ERROR, "Mixing codec types within an AdaptationSet
is not allowed\n");
+ return AVERROR(EINVAL);
+ } else if (os->as_idx) {
+ av_log(s, AV_LOG_ERROR, "Assigning a stream to more than one
AdaptationSet is not allowed\n");
+ return AVERROR(EINVAL);
+ }
+ os->as_idx = c->nb_as;
+
+ if (*p == ' ') state = new_set;
+ if (*p)
+ p++;
Nitpick: The state = new_set; statement could be on a separate line. I can
change that before pushing. Other than that, I think this is good to go.
// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel