From patchwork Fri Jun 28 23:03:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sfan5 X-Patchwork-Id: 13756 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 861874492A1 for ; Sat, 29 Jun 2019 02:03:53 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 63FC068AB83; Sat, 29 Jun 2019 02:03:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-oln040092068064.outbound.protection.outlook.com [40.92.68.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 29AD468AB41 for ; Sat, 29 Jun 2019 02:03:47 +0300 (EEST) Received: from HE1EUR02FT020.eop-EUR02.prod.protection.outlook.com (10.152.10.58) by HE1EUR02HT220.eop-EUR02.prod.protection.outlook.com (10.152.10.237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.15; Fri, 28 Jun 2019 23:03:45 +0000 Received: from AM5PR0602MB2882.eurprd06.prod.outlook.com (10.152.10.51) by HE1EUR02FT020.mail.protection.outlook.com (10.152.10.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.15 via Frontend Transport; Fri, 28 Jun 2019 23:03:45 +0000 Received: from AM5PR0602MB2882.eurprd06.prod.outlook.com ([fe80::3d07:2a40:3dee:620c]) by AM5PR0602MB2882.eurprd06.prod.outlook.com ([fe80::3d07:2a40:3dee:620c%7]) with mapi id 15.20.2032.016; Fri, 28 Jun 2019 23:03:44 +0000 From: Stefan _ To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH] dashdec: Fix reading values from SegmentTimeline inside, Period Thread-Index: AQHVLgW8D17saWyEPESC43Tnj65ugQ== Date: Fri, 28 Jun 2019 23:03:44 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-clientproxiedby: PR1PR01CA0016.eurprd01.prod.exchangelabs.com (2603:10a6:102::29) To AM5PR0602MB2882.eurprd06.prod.outlook.com (2603:10a6:203:9a::17) x-incomingtopheadermarker: OriginalChecksum:591CCB9B85BBA5658F75F21180B256D3651AB3CB3BE628E533590F20D6C960B8; UpperCasedChecksum:77DACBA4F430412CD4F79253548B47C68F8D9AAFE5918E9753B12E99423890A6; SizeAsReceived:7316; Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [lZ1L+bOI4j3/O+9H/ke5VRmX4aLcDHgcJ4FGGvQeENlxXRQIzNp+6nqMhdIWcbwQ] x-microsoft-original-message-id: <906dee23-c78a-d742-2de0-83141671e70b@live.de> x-ms-publictraffictype: Email x-incomingheadercount: 46 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045); SRVR:HE1EUR02HT220; x-ms-traffictypediagnostic: HE1EUR02HT220: x-microsoft-antispam-message-info: dynDst+k2qdCcSDRSThxtpFAkYAdkdgAMjAZTpk4CJlMp9H4R3efseyIDnQg4zkZq8Je0l5ICGMXKhHFFKOrzBNnnPLSpT47M+dBcWj3rag1E5QBFZ2ilgQENvcRmNf0vl+UE0UHBvp1HQUEJK1jDM5bNGwTIuEtMn42bQ9qni5r09lka0ycr1Vf6x2wp73Z MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 586b7022-aff0-40ee-ce8e-08d6fc1cddf7 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2019 23:03:44.6413 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR02HT220 Subject: [FFmpeg-devel] [PATCH] dashdec: Fix reading values from SegmentTimeline inside, Period X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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. From b0eceb6bbe0c931d8c67a22980816bf3f8dd0bbe Mon Sep 17 00:00:00 2001 From: sfan5 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