[FFmpeg-devel,1/3] fftools/ffmpeg: Don't mangle start time based on discontinuities for FLV

Submitted by Derek Buitenhuis on Nov. 21, 2018, 3:58 p.m.

Details

Message ID 20181121155848.201788-2-derek.buitenhuis@gmail.com
State New
Headers show

Commit Message

Derek Buitenhuis Nov. 21, 2018, 3:58 p.m.
As far as I can tell, this isn't valid here sicne FLV may not have added
streams yet.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 fftools/ffmpeg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Hendrik Leppkes Nov. 21, 2018, 4:31 p.m.
On Wed, Nov 21, 2018 at 4:59 PM Derek Buitenhuis
<derek.buitenhuis@gmail.com> wrote:
>
> As far as I can tell, this isn't valid here sicne FLV may not have added
> streams yet.
>
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
>  fftools/ffmpeg.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index a12208cce9..3bc42c8ca8 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -4373,7 +4373,8 @@ static int process_input(int file_index)
>          //       so we instead do it here as part of discontinuity handling
>          if (   ist->next_dts == AV_NOPTS_VALUE
>              && ifile->ts_offset == -is->start_time
> -            && (is->iformat->flags & AVFMT_TS_DISCONT)) {
> +            && ((is->iformat->flags & AVFMT_TS_DISCONT)
> +                && !!strcmp(is->iformat->name, "flv"))) {
>              int64_t new_start_time = INT64_MAX;
>              for (i=0; i<is->nb_streams; i++) {
>                  AVStream *st = is->streams[i];

Format name comparisons are basically always wrong. Don't we have
AVFMTCTX_NOHEADER for that?

- Hendrik
Derek Buitenhuis Nov. 21, 2018, 4:36 p.m.
On 21/11/2018 16:31, Hendrik Leppkes wrote:
> Format name comparisons are basically always wrong. Don't we have
> AVFMTCTX_NOHEADER for that?

I could change it to use that, yeah. I'll send a v2 that does, if
the author agrees it's the correct fix.

- Derek

Patch hide | download patch | download mbox

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index a12208cce9..3bc42c8ca8 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -4373,7 +4373,8 @@  static int process_input(int file_index)
         //       so we instead do it here as part of discontinuity handling
         if (   ist->next_dts == AV_NOPTS_VALUE
             && ifile->ts_offset == -is->start_time
-            && (is->iformat->flags & AVFMT_TS_DISCONT)) {
+            && ((is->iformat->flags & AVFMT_TS_DISCONT)
+                && !!strcmp(is->iformat->name, "flv"))) {
             int64_t new_start_time = INT64_MAX;
             for (i=0; i<is->nb_streams; i++) {
                 AVStream *st = is->streams[i];