diff mbox

[FFmpeg-devel] dashdec: Fix reading values from SegmentTimeline inside, Period

Message ID AM5PR0602MB2882F37419C01BDAFED052D3ECFC0@AM5PR0602MB2882.eurprd06.prod.outlook.com
State New
Headers show

Commit Message

sfan5 June 28, 2019, 11:03 p.m. UTC
Hi,

attached patch fixes a small oversight in dashdec.

YouTube uses DASH manifests structured like this for live recordings, 
seeking is currently broken in those cases.

Comments

Liu Steven June 29, 2019, 1:56 a.m. UTC | #1
> 在 2019年6月29日,07:03,Stefan _ <sfan5@live.de> 写道:
> 
> Hi,
> 
> attached patch fixes a small oversight in dashdec.
> 
> YouTube uses DASH manifests structured like this for live recordings, 
> seeking is currently broken in those cases.
> 
> <0001-dashdec-Fix-reading-values-from-SegmentTimeline-insi.patch>_______________________________________________
> 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".

LGTM

Thanks
Steven
Liu Steven July 1, 2019, 6:42 a.m. UTC | #2
> 在 2019年6月29日,上午7:03,Stefan _ <sfan5@live.de> 写道:
> 
> Hi,
> 
> attached patch fixes a small oversight in dashdec.
> 
> YouTube uses DASH manifests structured like this for live recordings, 
> seeking is currently broken in those cases.
> 
> <0001-dashdec-Fix-reading-values-from-SegmentTimeline-insi.patch>_______________________________________________
> 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".

Pushed

Thanks
Steven
diff mbox

Patch

From b0eceb6bbe0c931d8c67a22980816bf3f8dd0bbe Mon Sep 17 00:00:00 2001
From: sfan5 <sfan5@live.de>
Date: Sat, 29 Jun 2019 00:51:28 +0200
Subject: [PATCH] dashdec: Fix reading values from SegmentTimeline inside
 Period

This was missed in commit e752da546463e693865d92a837fc0e8d2b28db2e.
---
 libavformat/dashdec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 5727d13a51..f0f9aa1d59 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -842,7 +842,7 @@  static int parse_manifest_representation(AVFormatContext *s, const char *url,
     xmlNodePtr representation_segmenttemplate_node = NULL;
     xmlNodePtr representation_baseurl_node = NULL;
     xmlNodePtr representation_segmentlist_node = NULL;
-    xmlNodePtr segmentlists_tab[2];
+    xmlNodePtr segmentlists_tab[3];
     xmlNodePtr fragment_timeline_node = NULL;
     xmlNodePtr fragment_templates_tab[5];
     char *duration_val = NULL;
@@ -1003,9 +1003,10 @@  static int parse_manifest_representation(AVFormatContext *s, const char *url,
             xmlNodePtr fragmenturl_node = NULL;
             segmentlists_tab[0] = representation_segmentlist_node;
             segmentlists_tab[1] = adaptionset_segmentlist_node;
+            segmentlists_tab[2] = period_segmentlist_node;
 
-            duration_val = get_val_from_nodes_tab(segmentlists_tab, 2, "duration");
-            timescale_val = get_val_from_nodes_tab(segmentlists_tab, 2, "timescale");
+            duration_val = get_val_from_nodes_tab(segmentlists_tab, 3, "duration");
+            timescale_val = get_val_from_nodes_tab(segmentlists_tab, 3, "timescale");
             if (duration_val) {
                 rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 10);
                 av_log(s, AV_LOG_TRACE, "rep->fragment_duration = [%"PRId64"]\n", rep->fragment_duration);
-- 
2.22.0