From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3741843014 for ; Fri, 16 Sep 2022 09:28:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C5BCF68BBD6; Fri, 16 Sep 2022 12:28:11 +0300 (EEST) Received: from out162-62-57-49.mail.qq.com (out162-62-57-49.mail.qq.com [162.62.57.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E56F868B8EF for ; Fri, 16 Sep 2022 12:28:04 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1663320479; bh=QTCdBgrxPH6YtEafUORh+rZgZXiL0ab93rnlBxhrhIY=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=Iuekkq4Q04VfPb3poa2xchNQT7woaB4Kb/9P8GKq2YYsHqyY9P59k/HuNWEppF1dI 1EmZd9KwvOln6anaB6Nfu1UymQyzS59zcq3l8YdPReVOw960er/I0XuD/013Yh5wJE vQwc8ccqyJZTwMqMfx4P2eRi/nwa85P3fJDV+Itk= Received: from black ([14.153.76.231]) by newxmesmtplogicsvrsza8.qq.com (NewEsmtp) with SMTP id 6FA24257; Fri, 16 Sep 2022 17:27:58 +0800 X-QQ-mid: xmsmtpt1663320478tvkvy9chx Message-ID: X-QQ-XMAILINFO: MBjwNRQMz5zUAhCWZTDVEDqCU+Av/ldtOFHhGc85qdl2BsQuI2dgUay5OloWbb cETcLQqamvCzHi8zIScsDIjzUUZny30K7M8pwUSZTjL8/uXS3rAvVs3TTZsL6VEB8HqhoeWw4/l5 Kp6M+oIsIg2yAO6XYCMB5ai4a4FAX0vzo7v4H4mSr9PQayjQ2ySOF5kmSuZV4i/unYKwrCMCOtP6 n8olz8KXAqw5gQR2vWgPpirIqRK2RSFxq2iVA2pjA8fAWnZ4MwhxtY7uh0inbAv3h06tQqjyEVxO 4FVxvIuciuooyXJu5wZGWW/LGFkCaJvYp8r3zTsWc75ID5ZHVfSlA7BBSz282S+h0ivU3lVFusRU ElR+RgNSX0sAl+XjM/Yv3y4hXEIej/RA5ejSlSf8r6bMGliJvnyne4SbeK8oO+MQ/PLnoUZauJ5C /u+KvMyPEVvj26MqXRYjUpzM8jT/m2ZaHRYxOP/huTloGiFOcs4lINLkX3ZWheu2HNOCLVcMVizp J9ngcdGUW5g382pA7vDPrsngsM9G5ToUQNy6ZzyKb8Hb3nV8DpJF++mEbQ/OU4QHn3BQNnv7so15 U+WugfiN/weBHT3jYyHYrwmW1/dnyulm/6aKgJj5jW85V3L0RkC9siG2beouPLD26zF1+If0vr6v dpHFXRN/FYnXGbben6cuYAX8L2D5Xrnq3r/Q5EGEIaTmTZ2zDsJNv3Bixdbi1fXU/DiErnsJqpO2 KMFEQF/xqrMk9Na3A6IpwlhIcOrnyPy9qAN/Ak/OcQ38/wORVOvC8S0SI6v+3SE455Woup2ZgS5S 6zqifexzcH3ebJo4L6kszAjkG9MJPgq/lC8YF8M42nyHfGqEv3VhtFpnnAoMTvoIxVjU51SOamoT cQauHk5NX8yRtmsFbo/oeWVSGGvhy/XPha7VcMb9IUBkjybAwTwe95rC55T8rCeYdnEQfwcGPLdV EOZ7ABE907Znd2mzxBVdTuh5B7XmI/uy8IBv/xH0ahNb/fDHDlPA== From: "Zhao Zhili" To: "'FFmpeg development discussions and patches'" References: In-Reply-To: Date: Fri, 16 Sep 2022 17:27:58 +0800 X-OQ-MSGID: <00ab01d8c9ae$9c2b3740$d481a5c0$@foxmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIrbsU/ie83nyZcsWSKP16huie9Tq08ftfg Content-Language: zh-cn Subject: Re: [FFmpeg-devel] [PATCH] avformat/mov: get the correct fragment stsd_id when decrypting the sample X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: 'Wang Yaqiang' Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > From: Wang Yaqiang > > When determining whether a packet should be decrypted, > should use the stsd_id of the fragment where the current packet is located. > > Signed-off-by: Wang Yaqiang > --- > libavformat/isom.h | 1 + > libavformat/mov.c | 7 ++++--- > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/libavformat/isom.h b/libavformat/isom.h > index fd236b985f..64fb7065d5 100644 > --- a/libavformat/isom.h > +++ b/libavformat/isom.h > @@ -139,6 +139,7 @@ typedef struct MOVFragmentStreamInfo { > int index_base; > int index_entry; > MOVEncryptionIndex *encryption_index; > + int stsd_id; // current fragment stsd_id > } MOVFragmentStreamInfo; > > typedef struct MOVFragmentIndexItem { > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 35e2271b14..a2c6a4f2a3 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -4956,9 +4956,10 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) > av_log(c->fc, AV_LOG_TRACE, "frag flags 0x%x\n", frag->flags); > > frag_stream_info = get_current_frag_stream_info(&c->frag_index); > - if (frag_stream_info) > + if (frag_stream_info) { > frag_stream_info->next_trun_dts = AV_NOPTS_VALUE; > - > + frag_stream_info->stsd_id = frag->stsd_id; > + } > return 0; > } > > @@ -7223,7 +7224,7 @@ static int cenc_filter(MOVContext *mov, AVStream* st, MOVStreamContext *sc, AVPa > encryption_index = NULL; > if (frag_stream_info) { > // Note this only supports encryption info in the first sample descriptor. > - if (mov->fragment.stsd_id == 1) { > + if (frag_stream_info->stsd_id == 1) { > if (frag_stream_info->encryption_index) { > encrypted_index = current_index - frag_stream_info->index_base; > encryption_index = frag_stream_info->encryption_index; LGTM. _______________________________________________ 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".