diff mbox series

[FFmpeg-devel,v1,2/6] avformat/dashenc: cosmetics

Message ID 1587894562-30207-2-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 839d024fabf28438203b27253ef6f3491684d906
Headers show
Series [FFmpeg-devel,v1,1/6] fftools/ffmpeg: use local variable with same contents directly | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Lance Wang April 26, 2020, 9:49 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/dashenc.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

Comments

Jeyapal, Karthick April 26, 2020, 12:02 p.m. UTC | #1
On 4/26/20 3:19 PM, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavformat/dashenc.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> index b082536..5fbe4dd 100644
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -2149,22 +2149,22 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt)
>          av_compare_ts(elapsed_duration, st->time_base,
>                        seg_end_duration, AV_TIME_BASE_Q) >= 0) {
>          if (!c->has_video || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
> -        c->last_duration = av_rescale_q(pkt->pts - os->start_pts,
> -                                        st->time_base,
> -                                        AV_TIME_BASE_Q);
> -        c->total_duration = av_rescale_q(pkt->pts - os->first_pts,
> -                                         st->time_base,
> -                                         AV_TIME_BASE_Q);
> -
> -        if ((!c->use_timeline || !c->use_template) && os->last_duration) {
> -            if (c->last_duration < os->last_duration*9/10 ||
> -                c->last_duration > os->last_duration*11/10) {
> -                av_log(s, AV_LOG_WARNING,
> -                       "Segment durations differ too much, enable use_timeline "
> -                       "and use_template, or keep a stricter keyframe interval\n");
> +            c->last_duration = av_rescale_q(pkt->pts - os->start_pts,
> +                    st->time_base,
> +                    AV_TIME_BASE_Q);
> +            c->total_duration = av_rescale_q(pkt->pts - os->first_pts,
> +                    st->time_base,
> +                    AV_TIME_BASE_Q);
> +
> +            if ((!c->use_timeline || !c->use_template) && os->last_duration) {
> +                if (c->last_duration < os->last_duration*9/10 ||
> +                        c->last_duration > os->last_duration*11/10) {
> +                    av_log(s, AV_LOG_WARNING,
> +                            "Segment durations differ too much, enable use_timeline "
> +                            "and use_template, or keep a stricter keyframe interval\n");
> +                }
>              }
>          }
> -        }
>  
>          if (c->write_prft && os->producer_reference_time.wallclock && !os->producer_reference_time_str[0])
>              format_date(os->producer_reference_time_str,

LGTM.
diff mbox series

Patch

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index b082536..5fbe4dd 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -2149,22 +2149,22 @@  static int dash_write_packet(AVFormatContext *s, AVPacket *pkt)
         av_compare_ts(elapsed_duration, st->time_base,
                       seg_end_duration, AV_TIME_BASE_Q) >= 0) {
         if (!c->has_video || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
-        c->last_duration = av_rescale_q(pkt->pts - os->start_pts,
-                                        st->time_base,
-                                        AV_TIME_BASE_Q);
-        c->total_duration = av_rescale_q(pkt->pts - os->first_pts,
-                                         st->time_base,
-                                         AV_TIME_BASE_Q);
-
-        if ((!c->use_timeline || !c->use_template) && os->last_duration) {
-            if (c->last_duration < os->last_duration*9/10 ||
-                c->last_duration > os->last_duration*11/10) {
-                av_log(s, AV_LOG_WARNING,
-                       "Segment durations differ too much, enable use_timeline "
-                       "and use_template, or keep a stricter keyframe interval\n");
+            c->last_duration = av_rescale_q(pkt->pts - os->start_pts,
+                    st->time_base,
+                    AV_TIME_BASE_Q);
+            c->total_duration = av_rescale_q(pkt->pts - os->first_pts,
+                    st->time_base,
+                    AV_TIME_BASE_Q);
+
+            if ((!c->use_timeline || !c->use_template) && os->last_duration) {
+                if (c->last_duration < os->last_duration*9/10 ||
+                        c->last_duration > os->last_duration*11/10) {
+                    av_log(s, AV_LOG_WARNING,
+                            "Segment durations differ too much, enable use_timeline "
+                            "and use_template, or keep a stricter keyframe interval\n");
+                }
             }
         }
-        }
 
         if (c->write_prft && os->producer_reference_time.wallclock && !os->producer_reference_time_str[0])
             format_date(os->producer_reference_time_str,