]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/gxf.c
always export videostreams
[ffmpeg] / libavformat / gxf.c
index 58cd5e3427bf923ef508bb6f7adabee957cc45c2..897cdade0f1377e5133e93a25c4f772a3227acc5 100644 (file)
@@ -130,11 +130,13 @@ static int get_sindex(AVFormatContext *s, int id, int format) {
         case 20:
             st->codec->codec_type = CODEC_TYPE_VIDEO;
             st->codec->codec_id = CODEC_ID_MPEG2VIDEO;
+            st->need_parsing = 2; // get keyframe flag etc.
             break;
         case 22:
         case 23:
             st->codec->codec_type = CODEC_TYPE_VIDEO;
             st->codec->codec_id = CODEC_ID_MPEG1VIDEO;
+            st->need_parsing = 2; // get keyframe flag etc.
             break;
         case 9:
             st->codec->codec_type = CODEC_TYPE_AUDIO;
@@ -160,6 +162,13 @@ static int get_sindex(AVFormatContext *s, int id, int format) {
             st->codec->channels = 2;
             st->codec->sample_rate = 48000;
             break;
+        // timecode tracks:
+        case 7:
+        case 8:
+        case 24:
+            st->codec->codec_type = CODEC_TYPE_DATA;
+            st->codec->codec_id = CODEC_ID_NONE;
+            break;
         default:
             st->codec->codec_type = CODEC_TYPE_UNKNOWN;
             st->codec->codec_id = CODEC_ID_NONE;
@@ -488,7 +497,7 @@ static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int
     maxlen = FFMAX(maxlen, 200 * 1024);
     url_fseek(&s->pb, pos, SEEK_SET);
     found = gxf_resync_media(s, maxlen, -1, timestamp);
-    if (ABS(found - timestamp) > 4)
+    if (FFABS(found - timestamp) > 4)
         return -1;
     return 0;
 }