dashenc: replace attribute id with contentType for the AdaptationSet element

Message ID 1431239617-5568-1-git-send-email-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer May 10, 2015, 6:33 a.m.
id should be an integer, not a string. It is also optional, so use
contentType instead which is the proper attribute for these values.

This fixes an MPD validation error.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/dashenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin Storsjö May 10, 2015, 6:53 a.m. | #1
Hi,

On Sun, 10 May 2015, James Almer wrote:

> id should be an integer, not a string. It is also optional, so use
> contentType instead which is the proper attribute for these values.

I don't see anything in ISO/IEC 23009-1/2014 about id needing to be an 
integer - can you clarify where that requirement comes from? Otherwise we 
could scrap/reformulate this part of the commit message.

> This fixes an MPD validation error.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> libavformat/dashenc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> index fc5c823..f228b86 100644
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -503,7 +503,7 @@ static int write_manifest(AVFormatContext *s, int final)
>     }
>
>     if (c->has_video) {
> -        avio_printf(out, "\t\t<AdaptationSet id=\"video\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n");
> +        avio_printf(out, "\t\t<AdaptationSet contentType=\"video\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n");
>         for (i = 0; i < s->nb_streams; i++) {
>             AVStream *st = s->streams[i];
>             OutputStream *os = &c->streams[i];
> @@ -516,7 +516,7 @@ static int write_manifest(AVFormatContext *s, int final)
>         avio_printf(out, "\t\t</AdaptationSet>\n");
>     }
>     if (c->has_audio) {
> -        avio_printf(out, "\t\t<AdaptationSet id=\"audio\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n");
> +        avio_printf(out, "\t\t<AdaptationSet contentType=\"audio\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n");
>         for (i = 0; i < s->nb_streams; i++) {
>             AVStream *st = s->streams[i];
>             OutputStream *os = &c->streams[i];
> -- 
> 2.4.0

The patch itself is fine though - thanks!

// Martin
Martin Storsjö May 10, 2015, 6:59 a.m. | #2
On Sun, 10 May 2015, Martin Storsjö wrote:

> Hi,
>
> On Sun, 10 May 2015, James Almer wrote:
>
>> id should be an integer, not a string. It is also optional, so use
>> contentType instead which is the proper attribute for these values.
>
> I don't see anything in ISO/IEC 23009-1/2014 about id needing to be an 
> integer - can you clarify where that requirement comes from? Otherwise we 
> could scrap/reformulate this part of the commit message.

Oh, I found it in the "XML syntax" part in the standard, even though it 
wasn't mentioned in the verbal description of the id field.

The patch is ok then.

// Martin

Patch

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index fc5c823..f228b86 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -503,7 +503,7 @@  static int write_manifest(AVFormatContext *s, int final)
     }
 
     if (c->has_video) {
-        avio_printf(out, "\t\t<AdaptationSet id=\"video\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n");
+        avio_printf(out, "\t\t<AdaptationSet contentType=\"video\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n");
         for (i = 0; i < s->nb_streams; i++) {
             AVStream *st = s->streams[i];
             OutputStream *os = &c->streams[i];
@@ -516,7 +516,7 @@  static int write_manifest(AVFormatContext *s, int final)
         avio_printf(out, "\t\t</AdaptationSet>\n");
     }
     if (c->has_audio) {
-        avio_printf(out, "\t\t<AdaptationSet id=\"audio\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n");
+        avio_printf(out, "\t\t<AdaptationSet contentType=\"audio\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n");
         for (i = 0; i < s->nb_streams; i++) {
             AVStream *st = s->streams[i];
             OutputStream *os = &c->streams[i];