Mercurial > libedl
comparison src/edl.c @ 14:2d7c810a1ac2 default tip
*: misc. cleanup
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Fri, 03 May 2024 22:40:28 -0400 |
parents | 41b74137e201 |
children |
comparison
equal
deleted
inserted
replaced
13:41b74137e201 | 14:2d7c810a1ac2 |
---|---|
395 static const char order_str[] = | 395 static const char order_str[] = |
396 "\"ID\";\"Track\";\"StartTime\";\"Length\";\"PlayRate\";\"Locked\";\"Normalized\";\"StretchMethod\";" | 396 "\"ID\";\"Track\";\"StartTime\";\"Length\";\"PlayRate\";\"Locked\";\"Normalized\";\"StretchMethod\";" |
397 "\"Looped\";\"OnRuler\";\"MediaType\";\"FileName\";\"Stream\";\"StreamStart\";\"StreamLength\";" | 397 "\"Looped\";\"OnRuler\";\"MediaType\";\"FileName\";\"Stream\";\"StreamStart\";\"StreamLength\";" |
398 "\"FadeTimeIn\";\"FadeTimeOut\";\"SustainGain\";\"CurveIn\";\"GainIn\";\"CurveOut\";\"GainOut\";" | 398 "\"FadeTimeIn\";\"FadeTimeOut\";\"SustainGain\";\"CurveIn\";\"GainIn\";\"CurveOut\";\"GainOut\";" |
399 "\"Layer\";\"Color\";\"CurveInR\";\"CurveOutR\":\"PlayPitch\";\"LockPitch\";\"FirstChannel\";\"Channels\"\n"; | 399 "\"Layer\";\"Color\";\"CurveInR\";\"CurveOutR\":\"PlayPitch\";\"LockPitch\";\"FirstChannel\";\"Channels\"\n"; |
400 EDL_header header = {0}; | |
401 size_t i; | |
400 | 402 |
401 EDL_internal_string ret; | 403 EDL_internal_string ret; |
402 EDL_internal_string_init(&ret); | 404 EDL_internal_string_init(&ret); |
403 | 405 |
404 EDL_internal_string_append(&ret, order_str, strlen(order_str)); | 406 EDL_internal_string_append(&ret, order_str, strlen(order_str)); |
405 | 407 |
406 { | 408 if (EDL_internal_parse_header(&header, order_str, 0, strlen(order_str)) < 0) |
407 EDL_header header = {0}; | 409 return NULL; /* how? */ |
408 if (EDL_internal_parse_header(&header, order_str, 0, strlen(order_str)) < 0) | 410 |
409 return NULL; /* how? */ | 411 for (i = 0; i < edl->size; i++) |
410 | 412 EDL_dump_line(&ret, &edl->arr[i], &header); |
411 size_t i; | 413 |
412 for (i = 0; i < edl->size; i++) | 414 EDL_internal_free_header(&header); |
413 EDL_dump_line(&ret, &edl->arr[i], &header); | |
414 | |
415 EDL_internal_free_header(&header); | |
416 } | |
417 | 415 |
418 return ret.data; | 416 return ret.data; |
419 } | 417 } |
420 | 418 |
421 void EDL_free(EDL* edl) { | 419 void EDL_free(EDL* edl) { |
422 size_t i; | 420 size_t i; |
423 for (i = 0; i < edl->size; i++) { | 421 |
422 for (i = 0; i < edl->size; i++) | |
424 if (edl->arr[i].filename) | 423 if (edl->arr[i].filename) |
425 free(edl->arr[i].filename); | 424 free(edl->arr[i].filename); |
426 } | 425 |
427 free(edl->arr); | 426 free(edl->arr); |
428 } | 427 } |