diff mbox

[FFmpeg-devel,v2] avformat/hlsenc: add error message for encrypt fmp4 mode

Message ID 20180416062230.2892-1-lq@chinaffmpeg.org
State Accepted
Commit 783df2eb59ca2347af89e3eca3aef2ff12779178
Headers show

Commit Message

Liu Steven April 16, 2018, 6:22 a.m. UTC
and refine the warning message when use both hls_key_info_file and hls_enc

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Gyan April 16, 2018, 6:30 a.m. UTC | #1
On 4/16/2018 11:52 AM, Steven Liu wrote:

> +            av_log(s, AV_LOG_ERROR, "Encrypted fmp4 not yet supported\n");


>               av_log(s, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"
> -                  " will use -hls_key_info_file priority\n");
> +                  " ignoring -hls_enc\n");


LGTM.
Liu Steven April 16, 2018, 6:37 a.m. UTC | #2
> On 16 Apr 2018, at 14:30, Gyan Doshi <gyandoshi@gmail.com> wrote:
> 
> 
> 
> On 4/16/2018 11:52 AM, Steven Liu wrote:
> 
>> +            av_log(s, AV_LOG_ERROR, "Encrypted fmp4 not yet supported\n");
> 
> 
>>              av_log(s, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"
>> -                  " will use -hls_key_info_file priority\n");
>> +                  " ignoring -hls_enc\n");
> 
> 
> LGTM.

Pushed.


Thanks
Steven
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index c7540166ab..c27a66ea79 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1591,9 +1591,14 @@  static int hls_start(AVFormatContext *s, VariantStream *vs)
     }
 
     if (c->key_info_file || c->encrypt) {
+        if (c->segment_type == SEGMENT_TYPE_FMP4) {
+            av_log(s, AV_LOG_ERROR, "Encrypted fmp4 not yet supported\n");
+            return AVERROR_PATCHWELCOME;
+        }
+
         if (c->key_info_file && c->encrypt) {
             av_log(s, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"
-                  " will use -hls_key_info_file priority\n");
+                  " ignoring -hls_enc\n");
         }
 
         if (!c->encrypt_started || (c->flags & HLS_PERIODIC_REKEY)) {